How to trim leading and trailing asterisk (*) from a string in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string s = "**********c# c++ c java*****";

        s = s.Trim('*');
        
        Console.Write(s);
    }
}



/*
run:

c# c++ c java

*/

 



answered Jul 10, 2020 by avibootz

Related questions

1 answer 174 views
1 answer 146 views
1 answer 157 views
3 answers 363 views
1 answer 138 views
...