StringExtensions.Mid(this string source, int? startIndex, int? length) Method
.NET Standard 2.x
Obtains a specified number of characters from a specified position in a string.
Namespace: PowerScript.Bridge
Assembly: PowerScript.Bridge.dll
Syntax
public static string Mid(this string source, int? startIndex, int? length);
Parameters
source
System.String
The string from which you want characters returned.
startIndex
System.Int32
An int specifying the position of the first character you want returned. (The position of the first character of the string is 0
).
length
Sytem.Int32
An int whose value is the number of characters you want returned. If you do not enter length or if length is greater than the number of characters to the right of startIndex, Mid
returns the remaining characters in the source.
Returns
System.String
Returns characters specified in length of source starting at character startIndex. If startIndex is greater than the number of characters in source, the Mid
function returns the empty string (""). If length is greater than the number of characters remaining after the startIndex character, Mid
returns the remaining characters. The return string is not filled with spaces to make it the specified length. If any argument's value is null
, Mid
returns null
.
Examples
Coming soon.
Applies to
.NET Standard
2.x