string s = "ABDCEFG*HI"; s = s.Remove( s.LastIndexOf('*') ); //The output was supposed to be ABCDEFGHI without the * symbol, but in reality, it turns out to be ABCDEFG
string s = "ABDCEFG*HI"; s = s.Replace("*HI", "HI");
public string Remove( int startIndex, int count )
string s = "ABDCEFG*HI"; int nIndex = s.LastIndexOf('*'); if (nIndex > 0) s = s.Remove( nIndex, nIndex+1 );
string RemoveCharacter(string source, char c) { return source.Replace(c.ToString(),""); }
string s="ABCDEFGH*IJK*LMN*PQRST*UVWXYZ**"; s=RemoveCharacter(s,'*');
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)