I am seeking help creating a hash function that will take user data inputted from a string and convert it into an integer value, all the while skipping white spaces. I am stumped on why it's not working, and how to get it to get white spaces that may be entered and would appreciate the help.
Code:
public static void main(String[] args) {
Scanner inScan;
String inStr;
int outHash;
inScan = new Scanner(System.in); // Assignment of Scanner
System.out.print("Enter string to create hash: "); // Asks for String Input
inStr = inScan.nextLine(); // String Input
// Start of Hash Function
String hashValue = inStr;
hashValue = inStr.hashCode();
System.out.println(hashValue);