To add a whitespace seperator in a string we use String.Join().
My question:What(and how) do I have to remove that seperator.
The string's structure is the following "FF FF FF FF FF FF FF FF FF...."
How do I remove the white spaces?
To add a whitespace seperator in a string we use String.Join().
My question:What(and how) do I have to remove that seperator.
The string's structure is the following "FF FF FF FF FF FF FF FF FF...."
How do I remove the white spaces?
C# Has a function for it.
Function is String.Replace(oldstring, newString);
String.Replace(" ", "");
I don't think you need to use LINQ for this. Just split on whitespace and then re-join using an empty string as the separator. This would be best if you had mixed whitespace -- tabs, newlines, etc.
var newStr = string.Join( string.Empty, str.Split() );
or replace the whitespace with the empty string (this would be the best if all the whitespace where the same character).
var newStr = string.Replace( " ", string.Empty );