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:
Anonymous2009-03-19 18:47
>>1
I have no fucking clue what this is supposed to mean but I'll take a guess.
public class StringManipulator {
public static void main {
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;
}
}