How to get the first two letters of a string in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string s = "c# 9.0";
        
        Console.WriteLine(s.Substring(0, 2));
    }
}




/*
run:

c#

*/

 



answered Nov 1, 2020 by avibootz
...