last word of string to uppercase c#

69

last word of string to uppercase c# -

var res = sentence.Split(' ').Last().ToUpper();

last word of string to uppercase c# -

var res = sentence.Substring(sentence.LastIndexOf(' ') + 1).ToUpper()

Comments

Submit
0 Comments