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

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -