Getting a Substring - CSharp Language Basics

CSharp examples for Language Basics:string

Description

Getting a Substring

Demo Code

using System;/* ww w .ja v  a 2  s. c o  m*/
class MainClass {
   static void Main(string[] args) {
      string str = "Last night I dreamt of San Pedro";
      Console.WriteLine(str);
      string substr = str.Substring(23);
      Console.WriteLine(substr);
   }
}

Result


Related Tutorials