GUML -- Cmd Ref -- String

\htmlquote
\htmlquote{string to quote}

This function escapes '<', '>', '&' and '"' within the string to quote into '&lt;', '&gt;', '&amp;', and '&quot;'.

Example:
  \htmlquote{a string with a " in it} --> a string with a &quot; in it


\sqlquote
\sqlquote{string to quote}

This function converts a string with "'s to "" for Informix, MySQL, and SYBASE. For Oracle it converts ' to '';

Example:
  \sqlquote{a string with a " in it} --> a string with a " in it


\strcmp
\strcmp{string1}{string2}

This function returns -1 if string1 is less than string2, 0 if they're the same, or 1 if string1 is breater than string 2.

Example:
  \strcmp{aaa}{bbb} --> -1
  \strcmp{bbb}{bbb} --> 0
  \strcmp{bbb}{aaa} --> 1


\strindex
\strindex{string1}{string2}

This function returns the offset of string2 in string1, 0 based. If string2 is not found in string1, nothing is returned.

Example:
  \strindex{This is a test}{is a} --> 5
  \strindex{This is a test}{blah} -->
  \strindex{This is a test}{This} --> 0


\strip
\strip{bigstring}{characters to yank}
\strip{bigstring}{characters to leave}{1}

Both return the resulting stripped string.

Warning, common mistake:
  \strip{some string with spaces}{ }
should be
  \strip{some string with spaces}{\ }

Example:
  \strip{some string with spaces}{\ } --> somestringwithspaces
  \strip{some string with spaces}{rstlneo}{1} --> soestrntses


\strlength
\strlength{string}

This function returns the length of string.

Example:
  \strlength{This is a test} --> 14


\strlower
\strlower{string}

This function returns the lowercased string.

Example:
  \strupper{This is a test} --> THIS IS A TEST


\strsoundex
\strsoundex{string}{optional number of output chars}

This function returns a soundex of string.

Example:
  \strsoundex{Oregon}  --> O625
  \strsoundex{Oregan}  --> O625
  \strsoundex{Orageno} --> O625


\strtok
\strtok{string to tokenize || nothing}{token separators}

This function returns the first or next token from the string.

Example:
  \set{token}{\strtok{string to tokenize}{\ }}
  \while{
    \get{token}
  }{
    \get{token}<br>
    \set{token}{\strtok{}{\ }}
  }
yields:
  string
  to
  tokenize


\strupper
\strupper{string}

This function returns the uppercased string.

Example:
  \strupper{This is a test} --> THIS IS A TEST


\substr
\substr{string}{start}{count}

This function returns count characters from string starting at the 0 based start position. If start is greater than the length of the string, then nothing is returned. If count characters don't exist then as many that exist are returned.

Example:
  \substr{0123456789}{3}{4}  --> 3456
  \substr{0123456789}{10}{4} -->
  \substr{0123456789}{8}{4}  --> 89

show source
Copyright © 1999 by PureMagic Software for the GUML Project