I have a function which replace character.
public static string Replace(string value)
{
value = Regex.Replace(value, "[\n\r\t]", " ");
return value;
}
value="abc\nbcd abcd abcd\ "
if in string there is any unwanted white space they are also remove.Means I want result like this
value="abcabcdabcd".
Help to change Regex Pattern to get desire result.Thanks a lot.
If you need to remove any number of whitespace characters from the string, probably you’re looking for something like this:
where
\smatches any whitespace character and+means one or more times.