#I'm trying to split a string after a character.

3 messages · Page 1 of 1 (latest)

ebon night
#

Basically trying to get a players username in Minecraft and then splitting it down to just their name.
I have split the first part of their IGN but I need help with removing everything past the second color code.

    if (a != null && firstTwo(a).equals("§c")) {
    if (staffMember.contains(a))
      return;

    //staffMember.add(a);
    String splitName = a.replace("§c", "");
    if (a.contains("[")) {
            // Code i need help with. I want to remove everything after the username §c...
            // EX. Username§c [tag]
    }
    ChatUtils.message("" + splitName);
    updateStaff(splitName);

    }
sullen flowerBOT
#

This post has been reserved for your question.

Hey @ebon night! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.