Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Scroll tablelayout
sortDirectionASC
repeatTableHeadersdefaultstyle
widths20%, 10%, 13%, 57%
style
sortByColumn1
sortEnabledfalse
cellHighlightingtrue

...

Scroll tablelayout
sortDirectionASC
repeatTableHeadersdefaultstyle
widths18%, 15%, 14%, 15%, 38%
style
sortByColumn1
sortEnabledfalse
cellHighlightingtrue

...

Returns the "token" found with "string", or an empty string if the end of the string is reached.

Scroll pagebreak

Examples

Code Block
languagetext
// Demonstrate string tokenization.

...


string $str = "This is some text";

...


string $filepath = "c:/Program Files/ShogunPost#.#/SampleFiles/Day1/Test.hdf";

...


string $token;

...


 

...

// Tokenize the first string. Start off by "seeding" the strTok command with str.

...


// It will return the first token if one was found.

...


$token = `strTok $str`;

...


 

...

// Keep tokenizing until we have no more tokens

...


while( `strLength $token` != 0 )

...


{ 

...


     // Print out our token 

...


     print $token; 

...

     // Get the next token. Don't pass in $str, as we only need to seed it

...


     // in the beginning 

...

     $token = `strTok`;

...


}

...


// Now tokenize the file path. Tokenize it by folders, so use / as a delimiter

...


$token = `strTok $filepath -delims "/"`;

...


while( `strLength $token` != 0 )

...


{ 

...


     // Print out our token 

...

     print $token; 

...


     // Get the next token. don't pass in $filepath, as we only need to seed

...


     // it in the beginning 

...

     $token = `strTok -delims "/"`;

...


}

Additional information

Related commands

...