Check out example codes for "swift remove space from string". It will help you in understanding the concepts better.

Code Example 1

let freedSpaceString = str.filter {!$0.isWhitespace}

Learn ReactJs, React Native from akashmittal.com