c# - Uppercase problems -
how can output when i'm using replace , toupper in visual studio c#
firstname
here's code:
private void button1_click(object sender, eventargs e) { string input; input = combobox1.text; input = input.replace("_", ""); label1.text = input.first().tostring().toupper() + string.join("", input.skip(1)); }
the output this:
firstname
if input "first_name" works:
var text = "first_name"; text = string.join("", text .split('_') .where(x => !string.isnullorempty(x)) .select(x => new string( x .take(1) .select(c => char.toupperinvariant(c)) .concat(x.skip(1)) .toarray())));
Comments
Post a Comment