Command Prompt for Windows




Command STRSPLIT

Function:

Split a string at the specified position. The left half of the string is stored in an environment variable called STRSPLITA and the right half is stored in an environment variable called STRSPLITB.

Syntax:

STRSPLIT pos [text]
posPosition to split the string at, where the first character is at position 1, the second character is at position 2 and so on.
textSequence of characters.

Note:

Parameter pos can also be negative. The last character is at position -1, the second last character is -2 and so on.

The left half of the string will contain the characters from position 1 to position pos - 1 and the right half of the string will contain the characters from position pos to the end of the string.

Also see command SUBSTR, STRFIND, STRRFIND and Batch Files.