This is my string:
NStrring x=@"D1 - Damages";
and when i issue the [x substringFromIndex:2]
i got – Damages as the result instead of getting the D1
I just need to get the D1 as the returned string but the above statement is removing the D1 and returning the rest of the character.
You need to use
substringToIndex:2to getD1. You are usingsubstringFromIndexwhich is basically saying get the string starting FROM index 2 which will give you- Damages