I need to remove spaces from the end of a string. How can I do that? Example: if string is "Hello " it must become "Hello" 14 Answers 14
I want to have a percentage sign in my string after a digit. Something like this: 75%. How can I have this done? I tried: [NSString stringWithFormat:@"%d\%", someDigit]; But...
I have UTF-8 encoded NSData from windows server and I want to convert it to NSString for iPhone. Since data contains characters (like a degree symbol) which have different...
How can I convert a NSString containing a number of any primitive data type (e.g. int, float, char, unsigned int, etc.)? The problem is, I don’t know which number...
In Objective-C the code to check for a substring in an NSString is: NSString *string = @"hello Swift"; NSRange textRange =[string rangeOfString:@"Swift"]; if(textRange.location != NSNotFound) { NSLog(@"exists"); } But...
How do I test if an NSString is empty in Objective-C? 3Best Answer 31
How do I convert an NSString value to NSData? 14 s 14 NSString* str = @"teststring"; NSData* data =...
I’m developing a Cocoa application, and I’m using constant NSStrings as ways to store key names for my preferences. I understand this is a good idea because it allows...
Are there any shortcuts to (stringByAppendingString:) string concatenation in Objective-C, or shortcuts for working with NSString in general? For example, I’d like to make: NSString *myString = @"This"; NSString...