Substring
Public string substring (INT beginindex) returns a new string, which is a substring of this string. The substring starts with a character at the specified index until the end of the string.
For example:
"Unhappy". substring (2) returns "happy"
"Harbison". substring (3) returns "bison"
"Emptiness". substring (9) returns "" (an empty string)
Parameters:
Beginindex-the index at the beginning (including ).
Return Value:
The specified substring.
Throw:
Indexoutofboundsexception-If beginindex is negative or longer than the length of this string object.
--------------------------------------------------------------------------------
Substring
Public string substring (INT beginindex,
Int endindex) returns a new string, which is a substring of this string. The substring starts from the specified beginindex and ends with the index endindex-1. Therefore, the length of the substring is endindex-beginindex.
Example:
"Hamburger". substring (4, 8) returns "urge"
"Smiles". substring (1, 5) returns "Mile"
Parameters:
Beginindex-the index at the beginning (including ).
Endindex-the index at the end (not included ).
Return Value:
The specified substring.
Throw:
Indexoutofboundsexception-If inindex is negative, endindex is greater than the length of this string object, or beginindex is greater than endindex.
In C #, substring () has two overload functions.
Substring (int A) is used the same as above.
Substring (int A, int B) the length of the truncated string.
I do not know which syntax is used for the string above.
For C #