Home

News

International

Screen Shots

Documentation

Download

Build

License

Credits

Contact

SourceForge Project

Tintware Documentation : Tint Programming Language : Tint Reference : Strings : string.get

Syntax

#(%string)
#(%string.get)
#(%string.get-one)
#(%string.get-one,%nomore)
#(%string.get-n,%n)
#(%string.get-n,%n,%nomore)

%string is any string. %nomore is what should be returned if the offset is at the end of the string. %n is how many characters should be returned from the string.

All of these operations get zero or more characters starting from the current offset into the string. get-one and get-n advance the offset by the number of characters returned. All characters returned from a string are data. For get-n, if there are less than %n characters in the string between the offset and the end, then (end - offset) characters will be returned.

For get-n and get-one, if the offset is at the end of the string, meaning that there are no more characters available, then if %nomore is specified, it will be returned active.

Example

#(def,a-string,abcdefghijklm)

#(a-string)
abcdefghijklm
#(a-string.get)
abcdefghijklm
#(a-string.get-one)
a
#(a-string.get-n,4)
bcde
#(a-string)
fghijklm
#(a-string.get-n,200)
fghijklm
#(a-string.get-one)

#(a-string.get-one,no more)
no more
#(a-string.get-n,200,no more)
no more
#(a-string)