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 158 views
1 answer 160 views
2 answers 268 views
1 answer 116 views
1 answer 186 views
3 answers 278 views
...