Remove single quote from start of the string and end of the string
You can try .Trim()
like the following:
string inputStr = "'some string'";
string outputStr = inputStr.Trim(new char[]{(char)39});
Where (char)39
represents '
, and the .Trim()
will remove the first and last '
from the string; You can try like this as well:
string outputStr = inputStr.Trim('\'');
You can take a look into this Example
string inputStr = "'some string'";
string outputStr = inputStr.Trim('\'')