StringLength (StringTokenizer function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
<span style="font-size:120%; color:black"><b>Length of current tokenizing string</b></span>
{{Template:StringTokenizer:StringLength subtitle}}
[[Category:StringTokenizer methods|StringLength function]]
<!--DPL?? Category:StringTokenizer methods|StringLength function: Length of current tokenizing string-->
<!--DPL?? Category:System methods|StringLength (StringTokenizer function): Length of current tokenizing string-->
<p>
StringLength is a member of the [[StringTokenizer class]].
</p>


This method returns the length of the current tokenizing string.
This method returns the length of the current tokenizing string.
This string is the value of the [[String (StringTokenizer property)|String]] property.
This string is the value of the [[String (StringTokenizer property)|String]] property.
===Syntax===
==Syntax==
  %num = %tok:StringLength
{{Template:StringTokenizer:StringLength syntax}}
===Syntax terms===
===Syntax terms===
<dl>
<dl>
Line 19: Line 13:


</dl>
</dl>
===Usage Notes===
==Usage notes==
<ul>
<ul>
<li>The [[StartOfString (StringTokenizer function)|StartOfString]] function
<li>The [[StartOfString (StringTokenizer function)|StartOfString]] function
Line 27: Line 21:
returns the substring of the tokenizer string that follows the current position.
returns the substring of the tokenizer string that follows the current position.
</ul>
</ul>
===Examples===
==Examples==


The following statements return the length of the input string (that is, 24) into
The following statements return the length of the input string (that is, 24) into
Line 35: Line 29:
     %len = %toc:stringlength
     %len = %toc:stringlength
</pre>
</pre>
==See also==
{{Template:StringTokenizer:StringLength footer}}

Revision as of 19:54, 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 Stringlength example  '
    %len = %toc:stringlength

See also