Converting java string to uppercase without using toUpperCase method -
what have far
public string touppercase(string str) { int strlength = str.length(); string word = ""; while (strlength > 0) { char newstr = str.charat(strlength); character.touppercase(newstr); character.tostring(newstr); word += newstr; strlength--; } return word; }
i'm lost , code illogical. appreciated
to change string uppercase without using touppercase(), check below code.
if(ch>96 && ch<123) { ch=ch-32; system.out.print( (char) ch); }
check char small letter or not , if small subtract 32
Comments
Post a Comment