Problem Statement
Definition
- Class:
- TitleString
- Method:
- toFirstUpperCase
- Parameters:
- String
- Returns:
- String
- Method signature:
- String toFirstUpperCase(String title)
- (be sure your method is public)
Notes
- title may have leading or trailing spaces.
Constraints
- title will contain between 0 and 50 characters, inclusive.
- Each character of title will either be a space or a lowercase letter ('a' to 'z').
Examples
"introduction to algorithms"
Returns: "Introduction To Algorithms"
"more than one space between words"
Returns: "More Than One Space Between Words"
" lord of the rings the fellowship of the ring "
Returns: " Lord Of The Rings The Fellowship Of The Ring "
" "
Returns: " "
"i"
Returns: "I"
"the king and i"
Returns: "The King And I"
""
Returns: ""
"px ilfkus nj f ovql lkrjnn b"
Returns: "Px Ilfkus Nj F Ovql Lkrjnn B"
"y a"
Returns: "Y A"
"j shz"
Returns: "J Shz"
"xjj shkyckfvkyy ia pu"
Returns: "Xjj Shkyckfvkyy Ia Pu"
"kj"
Returns: "Kj"
"xaon"
Returns: "Xaon"
"mk lky lk u ybu qp "
Returns: "Mk Lky Lk U Ybu Qp "
"rl"
Returns: "Rl"
"ykexwcl y t "
Returns: "Ykexwcl Y T "
"c "
Returns: "C "
" hmsupo mrjo w svwzjqk qudaixfue ivemgsq "
Returns: " Hmsupo Mrjo W Svwzjqk Qudaixfue Ivemgsq "
"daf"
Returns: "Daf"
"vo gcdfzse"
Returns: "Vo Gcdfzse"
"rvrhg cr"
Returns: "Rvrhg Cr"
"gdsdhyizrevv"
Returns: "Gdsdhyizrevv"
"enapoktgxo lqloeslni "
Returns: "Enapoktgxo Lqloeslni "
"d "
Returns: "D "
"v"
Returns: "V"
"aqf lieekfwa a"
Returns: "Aqf Lieekfwa A"
"xws t hy qdggr mjwjqdyantvckpm bltlo "
Returns: "Xws T Hy Qdggr Mjwjqdyantvckpm Bltlo "
"bmis jb yzqtwmqr fvispgb"
Returns: "Bmis Jb Yzqtwmqr Fvispgb"
"wqoezwaxpl oc go"
Returns: "Wqoezwaxpl Oc Go"
" j"
Returns: " J"
" dvp uwyr"
Returns: " Dvp Uwyr"
" rlsiup wtxu uefvmlq vazh "
Returns: " Rlsiup Wtxu Uefvmlq Vazh "
"bnx sx"
Returns: "Bnx Sx"
"t"
Returns: "T"
"j"
Returns: "J"
"biqgx"
Returns: "Biqgx"
"lnmf hf tblckjj qyieklffauj"
Returns: "Lnmf Hf Tblckjj Qyieklffauj"
"u m iybj y "
Returns: "U M Iybj Y "
" marjzjff y "
Returns: " Marjzjff Y "
"xzbks"
Returns: "Xzbks"
"y mgvo rkscjax osup"
Returns: "Y Mgvo Rkscjax Osup"
"kss yko"
Returns: "Kss Yko"
"x tyurv l "
Returns: "X Tyurv L "
" s sf ksjll e ldah"
Returns: " S Sf Ksjll E Ldah"
" xkbmi glezojchtaqancpb"
Returns: " Xkbmi Glezojchtaqancpb"
"ja r wybmrallvp"
Returns: "Ja R Wybmrallvp"
"cgkxkwhrqgfstmxad nqtk vb mywkd"
Returns: "Cgkxkwhrqgfstmxad Nqtk Vb Mywkd"
"more than one space between words"
Returns: "More Than One Space Between Words"
"i"
Returns: "I"
" lord of the rings the fellowship of the ring "
Returns: " Lord Of The Rings The Fellowship Of The Ring "
" dupa a nie program"
Returns: " Dupa A Nie Program"
"more than one space between words"
Returns: "More Than One Space Between Words"
"i"
Returns: "I"
" lord of the rings the fellowship of the ring "
Returns: " Lord Of The Rings The Fellowship Of The Ring "
" dupa a nie program"
Returns: " Dupa A Nie Program"