selecting single or multiple letters in a string type variable
Author |
Message |
timtimpei
|
Posted: Thu May 01, 2008 7:52 pm Post subject: selecting single or multiple letters in a string type variable |
|
|
i was wondering how would you select a single or multiple letters/characters from a string type variable.
for example:
var name : string := "PETER"
and i only want to display the second letter of this name, in this case, the E.
is it possible? if not, wat is another solution? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
The_Bean
![](http://compsci.ca/v3/uploads/user_avatars/8459755754b4009cee84e9.jpg)
|
Posted: Thu May 01, 2008 8:05 pm Post subject: Re: selecting single or multiple letters in a string type variable |
|
|
strings can be used like arrays in which every letter has a spot in the string. So to only call the second letter in the string use " name(2)"
you can also look into the "index" function in the turing help files for other string manipulation technics. |
|
|
|
|
![](images/spacer.gif) |
|
|