Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > ToUpperCase and toLowerCase problems

Reply
Thread Tools

ToUpperCase and toLowerCase problems

 
 
jimgym1989 jimgym1989 is offline
Junior Member
Join Date: Aug 2008
Posts: 2
 
      08-05-2008
import javax.swing.JOptionPane;
import java.io.*;
import java.util.*;
import java.lang.*;
public class lowercasesandupper {

public static void main(String[]args)
{
String message;
int i;
String letter;
char let;
message=JOptionPane.showInputDialog("Enter the string: ");
message.length();

for(i=0;i<=message.length();i++)
{
letter = message.substring(i,i+1);
//message.charAt(i);
if(letter == message.toUpperCase())
{
System.out.println("Convert: "+letter.toLowerCase());
}
else
{
System.out.println("Convert: "+letter.toUpperCase());
}
}
}


}
/* I've been making this program for almost 3 days but I can't find the right algorithm..I want to convert all lowercase letters in a string to uppercase letters,and vice versa. For example, JIM will be converted to jim or anTHOny will be converted to ANthoNY. what's wrong with my program?*/
 
Reply With Quote
 
 
 
 
jimgym1989 jimgym1989 is offline
Junior Member
Join Date: Aug 2008
Posts: 2
 
      08-05-2008
This is Java Programming...
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving the web, charset problems and symbols problems Sak Na rede Ruby 0 01-30-2009 05:05 AM
toLowerCase and encoding eduardo.rosa@gmail.com Java 2 08-08-2006 05:11 PM
Problems compiling simple C++ code (also problems with std::string) Susan Baker C++ 2 06-26-2005 01:43 AM
toUpperCase vs IE Jimbo Javascript 2 12-07-2003 03:37 PM
Re: sound problems and modem problems Harold Potter Computer Support 5 12-04-2003 04:12 PM



Advertisments