substring

Summary

Extracts a substring.

Signatures

Click on a signature to select it and view its documentation.

Usage

public string substring(int indexA)

Returns

The extracted substring.

Parameters

indexA

The zero-based index to begin extracting the substring.

Description

Extracts a substring from the specified position until the end of the string. If the specified position is less than zero, it will be treated as zero. If the specified position is higher than the string length, the specified position will be treated as the string length.

Examples

Extracting substrings from a position until the end of the string
1
2
3
4
5
import System;
 
string abc = "abc";
Console.log(abc.substring(1)); // "bc"
Console.log(abc.substring(2)); // "c"

Share

HTML | BBCode | Direct Link