Link Search Menu Expand Document

UString.Substring Method

Explanation Cut out a part of the character string.

This method cuts out the character string without being aware of the character type of the target character string. Use the
mid function to cut out a character string that contains double - byte characters in the target character string.

The difference with Slice method
The smaller value of start and end is the start position of the character string to be acquired. (Substring (0, 3) and Substring (3, 0) have the same result)
If a negative value is specified for the argument, it is replaced with 0.
Call format var s = str.Substring( start, end )
Return value Cut out character string
Arguments integer start Leading position to cut out
Specify a number starting from 0
integer end End position to cut out (cut out to the character before the specified position)
Specify a number starting from 0
Exception Func-4 Invalid argument
Example of use
var str = new UString("abcdefghi");
print(str.Substring(1, 2), "\n");
    
Related item Slice method