Check out example codes for "remove whitespace between string c#". It will help you in understanding the concepts better.

Code Example 1

string str = "C Sharp";
str = Regex.Replace(str, @"\s", "");

Code Example 2

using System;
using System.Text.RegularExpressions;

public class Program
{
	public static void Main()
	{
		string yourString = "The value is: 99 086.78";
		string newString = "";	// MUST set the Regex result to a variable for it to take effect
		newString = Regex.Replace(yourString, @"\s+", ""); //Replaces all(+) space characters (\s) with empty("")
		Console.WriteLine(newString);
		// Output: Thevalueis:99086.78
	}
}

Code Example 3

string str = "C Sharp";
str = Regex.Replace(str, @"\s", "");

Learn ReactJs, React Native from akashmittal.com