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 205 views
1 answer 171 views
1 answer 202 views
3 answers 419 views
1 answer 168 views
1 answer 94 views
...