The world is currently online!


Welcome to Emps-World!

Register now to gain access to all of our forum features. Once registered and logged in, you will be able to create topics, post replies, send private messages, manage your profile, chat with other players in the shoutbox and much more. Once you sign in, this message will disappear.



Pages: 1
0 Members and 7 Guests are viewing this topic.

Offline Jp

  • *
  • 723
  • Liked: 1764 times
  • +0/-0
    • View Profile
'/' in clan chats
« on: August 11, 2016, 07:33:52 pm »
Can't type / in clan chats.
I.e typing 1/100 comes up as 1100.

Mary

Re: '/' in clan chats
« Reply #1 on: August 11, 2016, 08:47:27 pm »
obviously, since / counts as the start of a line in clan chat all / get negated

idk if theres a way around but ill leave your report here in case there is.

Offline Jonneh

  • *
  • 114
  • Liked: 578 times
  • +0/-0
    • View Profile
Re: '/' in clan chats
« Reply #2 on: August 11, 2016, 10:39:42 pm »
obviously, since / counts as the start of a line in clan chat all / get negated

idk if theres a way around but ill leave your report here in case there is.

message.replaceFirst("^/", ""); instead of message.replace("/", "");
ignore acc pls
The following users liked this post: Just Humen, Ranger 0wns

Mary

Re: '/' in clan chats
« Reply #3 on: August 12, 2016, 12:47:19 am »
obviously, since / counts as the start of a line in clan chat all / get negated

idk if theres a way around but ill leave your report here in case there is.

message.replaceFirst("^/", ""); instead of message.replace("/", "");
errors (illegal/unsupported escape sequence/@not null string regex)

   public String serialize() {
      return "{\"clan\":\"" + clan + "\",\"from\":\"" + from + "\",\"message\":\"" + message.replace("\\", "/").replace("\"", "\\\"") + "\"}";
   }

this' used for clanchat ._.

Offline Thomy

  • *
  • 3555
  • Liked: 3326 times
  • +5/-0
    • View Profile
Re: '/' in clan chats
« Reply #4 on: August 12, 2016, 02:30:18 pm »
The way java handles regexes is a bit exotic. I can just use replaceFirst with a simple string though. Thanks jonneh. :)
Pages: 1