...
Scroll tablelayout | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Scroll tablelayout | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Returns the "token" found with "string", or an empty string if the end of the string is reached.
Scroll pagebreak |
---|
Examples
Code Block | ||
---|---|---|
| ||
// 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
...