String.Substring 方法(System) | string substring
從這個執行個體擷取子字串。Retrievesasubstringfromthisinstance.子字串起始於指定的字元位置,並且具有指定的長度。Thesubstringstartsataspecifiedcharacterpositionandhasaspecifiedlength.public:System::StringSubstring(intstartIndex,intlength);publicstringSubstring(intstartIndex,intlength);memberthis.Substring:int*int->stringPublicFunctionSubstring(startIndexAsInteger,lengthAsInteger)AsString參數startIndexInt32[1]這個執行個體中子字串之以零為起始的起始字元位置。Thezero-basedstartingcharacterpositi...
從這個執行個體擷取子字串。Retrieves a substring from this instance. 子字串起始於指定的字元位置,並且具有指定的長度。The substring starts at a specified character position and has a specified length.
public: System::String Substring(int startIndex, int length); public string Substring (int startIndex, int length); member this.Substring : int * int -> string Public Function Substring (startIndex As Integer, length As Integer) As String 參數 startIndex Int32[1]這個執行個體中子字串之以零為起始的起始字元位置。The zero-based starting character position of a substring in this instance.
length Int32[2]子字串中的字元數。The number of characters in the substring.
傳回 String[3]與長度為 length 且在這個執行個體中從 startIndex 開始之子字串相等的字串;如果 Empty[4] 等於這個執行個體的長度且 startIndex 為零,則為 length。A string that is equivalent to the substring of length length that begins at startIndex in this instance, or Empty[5] if startIndex is equal to the length of this ...