I'm currently having some trouble pulling a single string from the values in a hash map.
Currently, I have a hash map that is setup as follows:
Map<Character, Character> keyMapping = new HashMap<Character, Character>();
for(int i = 0; i < rotor1.length(); i++) {
keyMapping.put(thirdKeyMapping.get(rotor1.charAt(i)), rotor2.charAt(i));
}
And when you print keyMapping
it renders an array as shown below:
println(keyMapping.values().toString());
//[F, S, Y, Q, N, I, D, X, B, E, H, Z, C, T, J, O, W, M, V, A, L, K, U, P, R, G]
How can I change this print line so that the value is a single string with only the letters? For example:
//FSYQNIDXBEHZCTJOWMVALKUPRG
Hopefully this is clear, but please let me know if there is any more information that I can provide to help answer this question.