Hi - I'm somewhat embarrassed to ask this but I'm having problems finding this in the docs.
Is there a function similar to "leftstring" in other languages that will return the specified contents of a string. Such as if x="123456" then leftstring(x,3) would return "123"
I know I could probably use find to do the same but was hoping its already there.
Thanks
/leonard
String functions help
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: String functions help
Revolution User Guide chapter 6: 'Processing Text and Data' page 174 onwards.
To get the left 3 characters:
put char 1 to 3 of "123456"
123
To get the right 3 characters
put char -3 to -1 of "123456"
456
Not that obvious but once you take the time to learn this chapter, processing text is really quite simple. And you can always make your own function leftstring that hides how Revolution does it.
Cheers,
Ismo
To get the left 3 characters:
put char 1 to 3 of "123456"
123
To get the right 3 characters
put char -3 to -1 of "123456"
456
Not that obvious but once you take the time to learn this chapter, processing text is really quite simple. And you can always make your own function leftstring that hides how Revolution does it.
Cheers,
Ismo
Re: String functions help
Thanks - knew it had to be that simple and somewhere in the docs.
/leonard
/leonard