I need to grab the whole arguments sequence as one single String, I'm using the following code, replacing commas and both square brackets.
Arrays.toString(args).replace(",", "").replace("[", "").replace("]", "");
Let's say I run it with the following arguments:
Hello, you're a programmer, you're a great guy
By using Arrays.toString() I'm getting:
[Hello, you're, a, programmer,, you're, a, great, guy]
So, by using the .replace() I actually get:
"Hello, you're a programmer, you're a great guy"
I just find the above code so messy, eventhough is working. How could I reduce such sentence in only one method?