Created
February 7, 2015 06:39
-
-
Save gclsoft/d0d82e1764014934dd87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)test:(NSString*)original{ | |
NSArray *originalParts = [original componentsSeparatedByString:@","]; | |
NSMutableString *newString = [NSMutableString new]; | |
for (NSString *string in originalParts) { | |
[newString appendString:[string stringByPaddingToLength:string.length + 7 withString:@" " startingAtIndex:0]]; | |
} | |
NSLog(@"Finished Product: %@", newString); | |
} | |
- (void)viewDidLoad { | |
NSString *original00 = @"Ann,Peter,Jackson"; | |
NSString *original01 = @"Anny,Pet,Jack"; | |
NSString *original = @"张三,李四六,一二三四"; | |
NSString *original2 = @"张三六,李,一三四"; | |
2015-02-07 14:37:41.753 HospitalCRM[43136:4865949] Finished Product: Ann Peter Jackson | |
2015-02-07 14:37:41.754 HospitalCRM[43136:4865949] Finished Product: Anny Pet Jack | |
2015-02-07 14:37:41.754 HospitalCRM[43136:4865949] Finished Product: 张三 李四六 一二三四 | |
2015-02-07 14:37:41.754 HospitalCRM[43136:4865949] Finished Product: 张三六 李 一三四 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment