LoginSignup
4
5

More than 5 years have passed since last update.

unity / dotnet > 文字列から"-"を取り除く > Linq使用版

Last updated at Posted at 2015-08-20

using System.Linq; // for Where

string removeHyphen(string src) {
    var dst = new string (src.Where (c => !"-".Contains (c)).ToArray ());
    return dst;
}

電話番号から"-"を抜く時などに使う。

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5