String_Middle

Returns the specified characters of the input string. The string parsing starts at the position specified, with 0 being the left-most character, so a position value of 0 is the same as String_Left.

Parameters

String

The string from which to get the characters.

Starting Position

The character with which to start.

Number of Characters

The number of characters to get from the end of the string.

Format

String_Middle (String, Starting Position, Number of Characters)

Return Value

Returns a string with just the middle n characters of the input string. If the input string is less than n characters, the entire string is returned.

Example

Script(String_Middle_Test)
String(strEntered)
String(strMiddlePart)
Number(nStart)
Number(nCharacters)
Activate(From_Menu)
strEntered = Ask_String("Enter some text", "String_Middle_Test", 1, 99, "")
nStart = Ask_Number("Enter start characters, zero is the first character", "String_Middle_Test", 0, 99, 2)
nCharacters = Ask_Number("Enter number of characters", "String_Middle_Test", 0, 99, 3)
strMiddlePart = String_Middle(strEntered, nStart, nCharacters)
Ask_OK(strMiddlePart, "String_Middle")
Return

See Also

String_Set, String_Combine, String_Left, String_Right, String_Upper, String_Lower, String_Replace, String_Only_Characters, String_Strip_Characters, String_Trim_Spaces_Start, String_Trim_Spaces_End, Number_To_String_Binary, Number_To_String_Octal, Number_To_String_Decimal, Number_To_String_Hexadecimal_Lowercase, Number_To_String_Hexadecimal_Uppercase, Ask_String, Ask_String_Password, Ask_String_Uppercase, Ask_String_Lowercase, String_Equal

 


Was this article useful?    

The topic was:

Inaccurate

Incomplete

Not what I expected

Other

Privacy and Legal