Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Another Java Question Niggers

Name: Anonymous 2009-03-19 16:13

I have a method that manipulates a string and returns said manipulated string. The problem is, that I don't know how to input a string into this method from "str = keyboard.nextLine();" (str being the string i need to put into the method) any kind anon have an idea. I have also tried a google search, no luck. Although I'm probably searching with the wrong keyword

Name: Anonymous 2009-03-19 18:49

>>10
Fixed so it actually compiles.
public class StringManipulator {
    public static void main(String[] args) {
        java.util.Scanner scan = new java.util.Scanner(System.in);
        while(true) {
            System.out.println(StringManipulator.manipulateString(scan.nextLine()));
        }
    }
    public static String manipulateString(String input) {
        java.util.Random r = new java.util.Random();
        char[] sussman = {'s','u','s','s','m','a','n'};
        String theSuss = "";
        while(true) {
            theSuss+=sussman[r.nextInt(sussman.length)]+"";
            if(theSuss.indexOf("sussman")>=0) break;
        }
        return theSuss;
    }
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List