Just wanted to know: does iOS UI Automation JavaScript support the substring
method? If yes, please provide a suitable example because I'm getting an error response for the same.
1 Answer
Use : substr()
var str="Hello world!";
var n=str.substr(2,3)
The result of n will be:
llo
It works. Tested.
P.S.Please accept anwser it if it works for you.
-
real problem is 'stackoverflow.com/questions/12841946/…'. See if you can help me on this :-|– MANNCommented Oct 11, 2012 at 14:31
-
@MANN: after going through above link , i think the approach is right. coincidentally I also did something like this for one of the UI automation project but stored function names in array. But there was no need of printing the function name so I haven't bothered about that. Commented Oct 12, 2012 at 3:32
-
thanks for the response. I just want to print a log where my queue is able to tell me which function it ran and how many times (say I want to store function name & count in some Array Map)!– MANNCommented Oct 12, 2012 at 13:32