Okay, so this is a bit confusing (well to me). I have a string that has a single number I want out of it. I have surrounded this number with \'/\' so that I will be able to
I think you have confusion in syntax of NSMakeRange. It is something like this
NSMakeRange(<#NSUInteger loc#>, <#NSUInteger len#>)
<#NSUInteger loc#>: It is the location from where you want to start picking or substring.
<#NSUInteger len#>: This is the length of your output or substring.
Example:
Mytest12test
Now I want to pick'12'
so:
NSString *t=@"Mytest12test";
NSString *x=[t substringWithRange:NSMakeRange(6, 2)] ;
In your code instead of length you are passing index of end character that is your mistake.