nsstring - iphone string initial char before space -


I have a question ... I want to take a string that contains a name and surname, the beginning of the first Surname complete .... Example:

  NSString * myName = @ "Mel Gibson"; // I want "M Gibson"; NSString * myName2 = @ "Leonardo DiCaprio"; // I want "El DiCaprio";  

thanks

  @implementation NSString (abbreviated framework ) - (NSString *) StringBabbreakingFirstWorld {// Step 1: Find White Positions Nsrange Whitespace: [[Self Range Offstring: @ ""]; If (whitespaceLoc.location == NSNotFound) returns itself; // Step 2: Remove all the letters between the first letter and the white space. NSRange RangeTorremov = NSMrange (1, Whitespace Public Location - 1); Return [Self String BayerPlacingExchange Strike: Seema Automovyw with String: @ ""]; } @end  

Comments