StringLength (StringTokenizer function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 10: Line 10:
<td>A numeric variable to contain the returned length of the tokenizing string. </td></tr>
<td>A numeric variable to contain the returned length of the tokenizing string. </td></tr>
<tr><th>%tok</th>
<tr><th>%tok</th>
<td>A StringTokenizer object variable.</td></tr>
<td>A <var>StringTokenizer</var> object variable.</td></tr>
</table>
</table>
==Usage notes==
==Usage notes==
Line 25: Line 25:
%len:
%len:
<pre>
<pre>
     %toc:string = 'A Stringlength example  '
     %toc:string = 'A <var>String</var>length example  '
     %len = %toc:stringlength
     %len = %toc:stringlength
</pre>
</pre>
==See also==
==See also==
{{Template:StringTokenizer:StringLength footer}}
{{Template:StringTokenizer:StringLength footer}}

Revision as of 21:47, 6 February 2011

Length of current tokenizing string (StringTokenizer class)


This method returns the length of the current tokenizing string. This string is the value of the String property.

Syntax

%number = stringTokenizer:StringLength

Syntax terms

%num A numeric variable to contain the returned length of the tokenizing string.
%tok A StringTokenizer object variable.

Usage notes

  • The StartOfString function returns the substring of the tokenizer string that precedes the first character of the current token. The RestOfString function returns the substring of the tokenizer string that follows the current position.

Examples

The following statements return the length of the input string (that is, 24) into %len:

    %toc:string = 'A <var>String</var>length example  '
    %len = %toc:stringlength

See also