wanting to convert printout to UPPER case
Code Java:
import java.util.*;
import java.io.File;
class assignment1{
public static void main (String[] args) throws Exception{
File alicefile = new File("alice.txt");
Scanner scan = new Scanner (alicefile);
String text;
for (int linenumber = 1; linenumber <= 20; linenumber++) //condition
{
text = scan.nextLine();
System.out.println(text);
}//end of loop block
scan.close();
}//end of method block
}//end of class block
this is what i have so far to read first 20 lines of text from a file. i now want to convert all printout to UPPER case. how would i do this. Thanks scott
Re: wanting to convert printout to UPPER case
What have you tried? Check out the String API for useful methods.
String (Java Platform SE 6)
Re: wanting to convert printout to UPPER case
text = text.toUpperCase();
Re: wanting to convert printout to UPPER case
Quote:
Originally Posted by
welikedogs
text = text.toUpperCase();
Did that work? Or did you have another question?
Re: wanting to convert printout to UPPER case
Quote:
did you have another question?
Like GimmeTehCodez™? ;)
db