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 119 views
1 answer 111 views
1 answer 124 views
1 answer 130 views
1 answer 160 views
1 answer 160 views
...