How to get the substring after specific character in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string str = "c# c java python php";
        
        var substring = str.Substring(str.IndexOf('p') + 1);

        Console.WriteLine(substring);
    }
}



/*
run:

ython php

*/

 



answered Aug 7, 2023 by avibootz

Related questions

1 answer 211 views
1 answer 198 views
1 answer 214 views
1 answer 236 views
1 answer 257 views
1 answer 247 views
...