All pastes #38297 Raw Edit

Miscellany

public text v1 · immutable
#38297 ·published 2006-01-24 05:36 UTC
rendered paste body
import java.lang.String.*;
import javax.swing.*;
import java.awt.*;
import java.util.*;

class billsue

{
	public static void main(String[] args)
 {
 
	Object[] possibleValues = { "charAt", "concat", "equals",
	 "equalsIgnoreCase", "format", "int length", "boolean matches",
	  "substring - start", "substring - start - end", "toLowerCase", "toUpperCase", "trim" };
	Object selectedValue = JOptionPane.showInputDialog(null,

    "Choose one", "Input",

	JOptionPane.INFORMATION_MESSAGE, null,

	possibleValues, possibleValues[0]);

	char bob;
	String bill = " Hello ";
	bob = bill.charAt(3);
	String sue = "Sue";
	String tom = " ";
	tom = bill.concat(sue);
	JFrame	myWindow;
    
    myWindow = new JFrame();
    JOptionPane.showMessageDialog(myWindow, "Hello ");
    JOptionPane.showMessageDialog(myWindow, "bob   ");
    JOptionPane.showMessageDialog(myWindow, "Tom's value is" + tom);
	myWindow.setTitle("Tom's value is"  + tom);
	
	boolean hill;
	String hay = "Hello world";
	String hoe = "Hoe";
	hill = hay.equals(hoe);
	JFrame myWindow1;
	myWindow1 = new JFrame();
	JOptionPane.showMessageDialog(myWindow1, "Message:  "  + hill);
	System.out.println("Message: " + hill);
		
	boolean joe;
	String zill = "Hi ";
	String jill = "jill";
	joe = zill.equalsIgnoreCase(jill);
	JFrame myWindow2;
	myWindow2 = new JFrame();
	JOptionPane.showMessageDialog(myWindow2, "Message:    "  + joe);
	System.out.println("Message:   " + joe);
	
	
	Calendar rightNow = Calendar.getInstance();
   	String s = String.format("The Date is: %1$tm %1$te,%1$tY", rightNow);
	System.out.println(s);
	
		String sb = new String("This is my life");
        int size = sb.length();
        
        System.out.println ("Length of String " + size);
        

	boolean flag; 
	String zoe = "killer";
	flag =  zoe.matches("cats and dogs"); 
	System.out.println ("Matches y / n "  + flag);
    
    String result;
    result = "hello".substring(2); 
    System.out.println(result);   
    
    String startend;
    startend = "hello, welcome to the top of the world".substring(2, 35);
    System.out.println(startend);
    
    String convertlower;
    convertlower = "CONVERTME".toLowerCase();
    System.out.println(convertlower);
    
    String convertupper;
    convertupper = "convertme".toUpperCase();
    System.out.println(convertupper);
    
    String clean;
    clean = "Lets remove all spaces and tabs 	".trim();
    System.out.println(clean);
    
    }	

}