How to get a substring from a specific character in a string to the end of the string with C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string str = "c c++ c# * java python";
 
        var substr = str.Substring(str.IndexOf("*"));
 
        Console.WriteLine(substr);
    }
}
 
 
 
/*
run:
 
* java python
 
*/

 



answered Apr 21, 2024 by avibootz

Related questions

1 answer 164 views
1 answer 165 views
2 answers 272 views
1 answer 121 views
1 answer 195 views
3 answers 286 views
...