let us consider this as a string--'Wi-Fi 1234ff'
i would like to trim this as -'wifi'
removing last 6 characters, special characters and space.
what i tried is to remove space-
NSString *trimmedString = [myString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
to remove special characters-by pointing ($) what character i want to remove
NSCharacterSet *trimmedString = [NSCharacterSet characterSetWithCharactersInString:@"$"];
string = [string stringByTrimmingCharactersInSet:trimmedString];
But wondering how could i remove 'x' number of strings from the end.
something like this..
if ([string length] > 0) {
string = [string substringToIndex:[string length] - x];
}