KRASCHE
&
BYRNE
         ELZED  HOME       NEWS       DOCS       DOWNLOADS       LICENSING       SUPPORT       FAQ       ABOUT  US

What's An Elzed?
Features
Licensing
Downloads
Documentation
Elzed News
    ELZED 
 Documentation 
 The Details 
 Internal Operators 

String Operators

Several built-in Elzed operators work with string data. In addition to their described functions, each of these operators may be used as the right side of an assignment. A note on usage in the following examples: in cases where string is passed as a parameter, understand that the parameter may be a string constant or a string variable. In the cases where string variable is passed, however, only a string variable may be used. See the string append operator below for an example.

left substring

left( string, count )

Returns the leftmost count characters of string. For example, left( "omnivore", 4 ) returns "omni".

middle substring

mid( string, index, count )

Returns the count characters from string, starting at position index. For example, mid( "omnivore", 3, 4 ) returns "ivor". The first position of an n-length string is zero; the last is n-1.

right substring

right( string, count )

Returns the rightmost count characters of string. For example, right( "omnivore", 3 ) returns "ore".

string append

string variable += string

Adds string to the end of string variable. For example, if variable my_string contains "pass ", then my_string += "the haggis" places the value "pass the haggis" into string variable my_string.

string concatenation

string + string

Returns the combination of two strings. For example, "hand me " + "that piano" returns "hand me that piano".

string insert

insert( string variable, string, index )

Places string in string variable at position index. For example, if variable my_string contains "Push the Max", insert( my_string, " button", 8 ) places the value "Push the button Max" into string variable my_string. The first position of an n-length string is zero; the last is n-1.

string length

length( string )

Returns the length of string. The terminating null is not included in the length.

string replace

replace( string variable, string, index, count )

Replaces count characters at position index of string variable with the first count characters of string. For example, if variable my_string contains "We're out of beans already", replace( my_string, "cocoa", 12, 5 ) places the value "We're out of cocoa already" into string variable my_string. The first position of an n-length string is zero; the last is n-1. The count parameter is optional; if omitted, the length of string is used as the replacement length.



  Copyright  ©  MMXXIV  by  R R Le Cropane   •   All Rights Reserved   •   Terms of Use   •   Privacy Policy