Mobile Line Of Business

Richard Jones (MVP)

  Home  |   Contact  |   Syndication    |   Login
  202 Posts | 0 Stories | 36 Comments | 0 Trackbacks

News

Welcome to the Mobile Line Of Business Blog

Tag Cloud


Archives

Post Categories

About

Now this might be sacrilege to some,  and a blessing to others.

Through using Objective C,   I realise that I really miss the ability to do C# quick and easy string manipulation, like -

IndexOf
Trim
Replace
Substring
Split
etc.

For my own sake,  I’ve begun working on some functional equivalents.

So far I’ve got

 

- (NSInteger) LastIndexOf:(NSString *)searchstring;

- (NSInteger) LastIndexOfI:(NSString *)searchstring;

- (NSInteger) IndexOf:(NSString *)searchstring;

- (NSInteger) IndexOfI:(NSString *)searchstring;

- (NSString *) PadLeft:(NSInteger)totallength;

- (NSString *) PadRight:(NSInteger)totallength;

- (NSString *) Remove:(NSString *)what;

- (NSString *) RemoveI:(NSString *)what;

- (NSString *) Replace:(NSString *)what with:(NSString *)with;

- (NSString *) ReplaceI:(NSString *)what with:(NSString *)with;

- (NSString *) SubString:(NSInteger)start;

- (NSString *) SubString:(NSInteger)start length:(NSInteger)length;

- (NSString *) Trim;

- (NSString *) LTrim;

- (NSString *) RTrim;

- (NSArray *) Split:(NSString *)

Full source available here -

 

Or if link doesn't work Click Contact Me, and I'll send you a copy

posted on Monday, March 21, 2011 7:02 AM