I have a Array:NSString that look like
[X1],[Tester],[123],[456],[0]
Now i have to check if a position (always the same) is a number or a string
So i tried
var test = Array[0].intValue
print(test)
but as [0] is a string it should not return 0 as it also could be [4]
0
is there a way to check if a NSString is a number only (return of true/false would be enough)?
full code example
var Array: [NSString] = ["X1","Fabian","100","200","not avaible"]
/* could also be Array:
var Array0: [NSString] = ["X2","Timo","200","300","300"]
*/
//need to check if Array[4] is a number or not so its "text" or "number"
var test = Array[4].intValue
print(test)
//return 0