#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
/*
NSString *str = @" hjghf kjl op ";
str = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
NSLog(@"str=%@",str);
*/
char c[100];
char c1[100];
printf("输入一个字符串");
gets(c);
long len = strlen(c);
for (int i = 0; i < len; i++) {
c1[i] = c[i+1];
}
c1[len-2] = '\0';
printf("c=%s",c1);
}
return 0;
}
|
|