1

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 1

2

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.

3
  • real problem is 'stackoverflow.com/questions/12841946/…'. See if you can help me on this :-|
    – MANN
    Commented 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)!
    – MANN
    Commented Oct 12, 2012 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.