Hey everyone,
This may seem a little trivial, but here it goes anyway: I'm trying to write a java program that will take in file names as Strings and then look through the name for whitespace and replace it with a _. Reading the file names in is no problem, however then fundamental aspect of changing the characters doesn't work. Here is the code for that part:
Code:
for (int i = 0; i < args.length; i++)
{
System.out.println("Before: " + args[i]);
args[i] = args[i].replace(' ', '_');
System.out.println("After : " + args[i]);
}
where args is an array of strings containing the file names. I know this doesn't physically change the file names, I'm just testing to see if it will actually do it, which it doesn't. Anyone know why? Thanks.