I'm forced to do a project in Objective-C (I usually use C/C++ or Java), so this may seem like a dumb or basic question.
I have two NSStrings and a char:
// This is the string containing the file's text
// path was defined earlier and this seems to work
myString = [[NSString alloc] initWithContentofFileath];
// This is the string I want to create
NSString *tempString = [[NSString alloc] initWithString""];
// temp char to put 1st char of myString into
char *tempChar;
I want to take the first character of myString and put it into tempChar. I'm going to test tempChar and then either discard it or put it to the end of tempString.
So to make it easy, can someone give me some lines of code that:
1. Set tempChar to the first char of myString
2. Remove the first letter of myString but keep the rest of the string
3. Add the char in tempChar to the end of tempString
Thanks for any help
I have two NSStrings and a char:
// This is the string containing the file's text
// path was defined earlier and this seems to work
myString = [[NSString alloc] initWithContentofFileath];
// This is the string I want to create
NSString *tempString = [[NSString alloc] initWithString""];
// temp char to put 1st char of myString into
char *tempChar;
I want to take the first character of myString and put it into tempChar. I'm going to test tempChar and then either discard it or put it to the end of tempString.
So to make it easy, can someone give me some lines of code that:
1. Set tempChar to the first char of myString
2. Remove the first letter of myString but keep the rest of the string
3. Add the char in tempChar to the end of tempString
Thanks for any help