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;
}
}
精彩评论