| | |
toUpperCase
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2008
Posts: 2
Reputation:
Solved Threads: 0
How do I change the ASCII value of the character? It seems to give me the values but I don't know how to change them. I am not sure how to do it right.
public void toUpperCase(){
// if ((ch >='a')&&(ch <='z'))
// return(char)(ch-32); // Explicit
// return ch;
for(int i = 0; i < theString.length; i++){
System.out.println("i="+i);
if (((int)theString[i] >=97)&&((int)theString[i] <=122))
{ theString[i]= (int)theString[i]-32;
}
System.out.println("j="+(int)theString[i]);
// Explicit
}
} Java has it's own function defined called toUpperCase(char ch).
http://java.sun.com/javase/6/docs/ap...oUpperCase(int)
http://java.sun.com/javase/6/docs/ap...oUpperCase(int)
Last edited by joshSCH; Feb 15th, 2008 at 10:08 pm.
![]() |
Similar Threads
- get/set Methods in java (Java)
- Need Advice on for loops with vowels (Java)
- Array Values not found in Methods (Java)
- Program Compiles fine, but error upon Running (Java)
- Scanf Equivalent (Java)
- String Class Of Java (Java)
- Mortgage Program help (Java)
Other Threads in the Java Forum
- Previous Thread: Some difficulty with loops
- Next Thread: Need advice
Views: 893 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Java
6 android api apple applet application arguments array arrays automation binary bluetooth bold byte c++ chat class classes client code component coordinates database datagram doctype draw eclipse educational error event exception file fractal froglogic game givemetehcodez graphics gui helpwithhomework html ide ideas image ingres input integer internet intersect ip j2me java javaexcel javaprojects jmf jni jpanel jtextarea julia linux list loop map method methods mobile netbeans newbie nextline number object oracle pong print problem program programming project recursion recursive scanner screen sell server set size sms socket sort sql string swing test threads time transfer tree user web websites windows






