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
...