Get substring from the middle in CSharp
Description
The following code shows how to get substring from the middle.
Example
using System; /* w ww. j a v a 2 s . com*/
public class SubStr {
public static void Main() {
string orgstr = "C# makes strings easy.";
// construct a substring
string substr = orgstr.Substring(5, 12);
Console.WriteLine("orgstr: " + orgstr);
Console.WriteLine("substr: " + substr);
}
}
The code above generates the following result.