开发者

Remove White Space Characters From String

String variable stores value as like .. careteam order 4-26-11.csv

i need to trim the value .. in c# as 开发者_开发技巧like careteamorder4-26-11.csv - by removing the space ..!

how to remove empty space in the string variable ?


string trimmed = "careteam order4-26-11.csv".Replace(" ", string.Empty);


    public string RemoveSpaceAfter(string inputString)
    {
        try
        {


            string[] Split = inputString.Split(new Char[] { ' ' });
            //SHOW RESULT
            for (int i = 0; i < Split.Length; i++)
            {
                fateh += Convert.ToString(Split[i]);
            }
            return fateh;
        }
        catch (Exception gg)
        {
            return fateh;
        }
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜