-1

I'm having trouble fully understanding arrays. I understand what a int array is, a set of numbers grouped together with their own locations, but I don't understand the purpose of string arrays vs strings, or how to get the user to input a string.

So, I have to make it so that the user enters a string with a % somewhere, and then another string, where the % is, the second string they enter needs to go there. I am NOT looking for a copy paste thing, but an explanation on what code I should use an what it does for that action.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

1 Answers1

0

You need a java.util.Scanner

You would enter a String containing a % character

Then, you String#replace that value with a second input string.

No arrays necessary...

Community
  • 1
  • 1
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245