Remove white space characters from a string

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

I need to trim the value .. in C # like t careteamorder4-26-11.csv - removing the space ..!

how to remove empty space in string variable?

+7
source share
2 answers
  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
source
 string trimmed = "careteam order4-26-11.csv".Replace(" ", string.Empty); 
+42
source

All Articles