Check out example codes for "C# regex replace all spaces with blank". It will help you in understanding the concepts better.

Code Example 1

LastName = Regex.Replace(LastName, @"\s+", "");

Learn ReactJs, React Native from akashmittal.com