|
Turkey_March Newbie
Joined: 18 Apr 2007 Posts: 3
|
Posted: Wed Apr 18, 2007 11:32 am
How do I access the nth character of a string? |
Say I have the variable
#VAR Example {Hello world}
and I want to #SAY whatever the seventh character is ("w", in this case). What's the easiest way to do this? Looking at the documentation, it's possible to copy Example to a temporary variable, %delete the first six characters, and then call the %left function, but this seems like a waste of CPU cycles. |
|
|
|
Zwartje Novice
Joined: 08 Feb 2007 Posts: 45
|
Posted: Wed Apr 18, 2007 11:45 am |
This should do the trick:
#SHOW %copy("Hello world",7,1) |
|
|
|
Turkey_March Newbie
Joined: 18 Apr 2007 Posts: 3
|
Posted: Wed Apr 18, 2007 11:50 am |
That's what I was looking for, thank you.
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|