Net Replace conversion problem, how to remove the $before and after id

encounter item.Selected conversion problem when revamping website
add "$" such as
< option selected= "selected" value= "$6$" > red < / option >
< option value= "$3$" > black < / option >
< option value= "$5$" > blue < / option >
< option selected= "selected" value= "$2$" > White < / option >
< option value= "$4$" > green < / option > <

Save the database code:
string Colors = string.Empty;
foreach (ListItem item in LBColor.Items) {
if (item.Selected) {

  Colors += item.Value+" ";

}
}
pro.Colors = Colors.Trim (). Replace (",",);

Save to the database with the above code, the value of colors is: $6 colors, 2 colors, 1 $.

ask for advice on how to remove $before and after id

Thank you

Mar.02,2021

Colors = Colors.Replace ("$", ").
PS: temporary variable begins with lowercase.


    var str = "$$$$";
    function stripscript(s) {
        var pattern = new RegExp("[`~!@-sharp$^&*()=|{}':;',\\[\\].<>/?~@-sharp&*|{} ';:" "']")
        //("[]")
        //("[$]")
        var rs = "";
        for (var i = 0; i < s.length; iPP) {
            rs = rs + s.substr(i, 1).replace(pattern, '');
        }
        return rs;
    }
    

call the above method of removing special symbols

alert(stripscript(str));

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2c01f-2bae7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2c01f-2bae7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?