Dear fellow programmers
I'm developing a Java plugin for my minecraft server. Now my issue is that I have a / in a string and want to replace it with nothing AKA "". I tried to use "/", "/", "\/" and "slash" in the first parameter of the replaceFirst method. Either didn't work.
Here is my code:
if (command.startsWith("/")) {
command.replaceFirst("\\/", "");
System.out.println("After replace: " + command);
target.performCommand(command);
sender.sendMessage("§5" + target.getName() + "§a performed the command §5/" + command);
}
If you know how I could do this thanks for your help in advance :)