I am making a chat. and i have everything working. But i would like to implement commands that the user can run by typing / then the command. I was thinking i would test for the '/' char at index 0. And if thats true i would run that "code". So the user would essentially be calling a method. but i cant figure out how to convert the string into java code. Help would be appreciated. And if anyone has an easier method of how to implement commands feel free to let me know.
Where
String userinput = "/test()";
Thanks