Truncate white space in text in iphone/objective c -


Is there a function to remove white spaces from text messages in Objective C?

For example: For "How are you", the result should be "howareyou"

Thank you in advance.

You can use components of NSString to set the sensor with whitespace SeparateBearactors Set the inserts, first whotspace Split the string on, and then join the component using componentsJoinedByString of NSArray.

For example.

  NSString * myString = @ "How are you"; MyString = [[[MyString Components] SeparatorActors Inset: [NSCharacterSet whitespaceCharacterSet]] componentsJoinedByString: @ ""]; NSLog (myString); // display haureau  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -