- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How to get one character at a time from a string?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-28-2009 12:34 PM
Hi,
I have a number "set num 215" and I like to get one digit at a time (2, 1, 5). How do I do that?
In tcl, I can use "string index num 0" to get the first digit. And "string index num 1" to get the second digit. ...
How can I do this in iTest?
-Jeffrey
Solved! Go to Solution.
Re: How to get one character at a time from a string?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-28-2009 04:58 PM
This appears to be a bug in iTest. [string index ...] should be supported, but appears to be missing.
As a workaround, you can use [string range str lower upper]. For example, [string range "abc" 1 1] will return "b".
Re: How to get one character at a time from a string?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-28-2009 05:15 PM
iTest is not supporting string split right now. Are you going to add that in?
Thanks.
Re: How to get one character at a time from a string?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-28-2009 05:18 PM
Re: How to get one character at a time from a string?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-28-2009 05:44 PM
Re: How to get one character at a time from a string?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-29-2009 08:39 AM
