Retrieves a substring from the current String object. The substring starts at a specified index number, or character position, in the String object.Namespace: System Assembly: mscorlib (in mscorlib.dll)SyntaxC# 複製 [MethodImplAttribute] public string Substring ( intstartIndex ) ...
Substring(Int32) Retrieves a substring from this instance. The substring starts at a specified character position. Substring(Int32, Int32) Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length. Top See Also Reference String Cla...
Retrieves a substring from this instance. This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.
publicclassJavaExample{publicstaticvoidmain(String[]args){//given stringStringstr="Welcome to [BeginnersBook.com]";//we would like to get the substring between '[' and ']'intstart=str.indexOf("[");intend=str.indexOf("]");StringoutStr=str.substring(start+1,end);System.out.println(outSt...
Retrieves a substring of the full string from the specified range. C# 复制 public virtual string Substring(int offset, int count); Parameters offset Int32 The position within the string to start retrieving. An offset of zero indicates the starting point is at the start of the data. count...
Retrieves a substring from the current String object. The substring starts at a specified index number, or character position, in the String object.Namespace: System Assembly: mscorlib (in mscorlib.dll)SyntaxC# Copy [MethodImplAttribute] public string Substring ( int startIndex ) ...
1. substring(int beginIndex) The first variant of the substring() method accepts only one parameter. i.e. beginIndex The substring will start from the specified beginIndex and it will extend to the end of the string. public String substring(int beginIndex) Returns a string that is a substring...
Join Method (String, String[], Int32, Int32) LastIndexOf Method LastIndexOfAny Method PadLeft Method PadRight Method Remove Method Replace Method Split Method StartsWith Method Substring Method ToCharArray Method ToLower Method ToLowerInvariant Method ...
Insert(Int32, String) Join(String, String[]) Remove(Int32, Int32) Replace(Char, Char) Split(Char[]) Substring(Int32) Trim(Char[])在GitHub 上与我们协作 可以在 GitHub 上找到此内容的源,还可以在其中创建和查看问题和拉取请求。 有关详细信息,请参阅参与者指南。 .NET 反馈 .NET 是一个开...
Join Method (String, String[]) Join Method (String, String[], Int32, Int32) LastIndexOf Method LastIndexOfAny Method PadLeft Method PadRight Method Remove Method Replace Method Split Method StartsWith Method Substring Method ToCharArray Method ...