S
sklett
I need to take a string, make the first character lowercase and prepend an
underscore character to it. Something like this:
"California"
"_california"
Here is the (ugly) solution I cam up with:
There must be a better way... is there?
underscore character to it. Something like this:
"California"
"_california"
Here is the (ugly) solution I cam up with:
Code:
public static string MakeNetSuiteStateName(string normalStateName)
{
string firstChar = normalStateName.Substring(0, 1);
string restOfName = normalStateName.Substring(1);
string newName = "_" + firstChar.ToLower() + restOfName;
return newName;
}
There must be a better way... is there?