Skip to main content
deleted 25 characters in body
Source Link
jahilldev
  • 3.9k
  • 7
  • 39
  • 53

I have the following:

var serv = "chat"

serv match {
                
    case "chat" => Chat_Server ! Relay_Message(serv)
    case _ => null

}

The problem is that sometimes I also pass an additional param on the end of the serv string, so:

var serv = "chat.message"

Is there a way I can match a part of the string so it still gets sent to Chat_Server?

Thanks for any help, much appreciated :)

I have the following:

var serv = "chat"

serv match {
                
    case "chat" => Chat_Server ! Relay_Message(serv)
    case _ => null

}

The problem is that sometimes I also pass an additional param on the end of the serv string, so:

var serv = "chat.message"

Is there a way I can match a part of the string so it still gets sent to Chat_Server?

Thanks for any help, much appreciated :)

I have the following:

serv match {
                
    case "chat" => Chat_Server ! Relay_Message(serv)
    case _ => null

}

The problem is that sometimes I also pass an additional param on the end of the serv string, so:

var serv = "chat.message"

Is there a way I can match a part of the string so it still gets sent to Chat_Server?

Thanks for any help, much appreciated :)

added 5 characters in body
Source Link
om-nom-nom
  • 62.9k
  • 13
  • 186
  • 231

I have the following:

var serv = "chat"

serv match {
                
    case "chat" => Chat_Server ! Relay_Message(serv)
    case _ => null

}

The problem is Ithat sometimes I also pass an additional param on the end of the serv string, so:

var serv = "chat.message"

Is there a way I can match a part of the string so it still gets sent to Chat_Server?

Thanks for any help, much appreciated :)

I have the following:

var serv = "chat"

serv match {
                
    case "chat" => Chat_Server ! Relay_Message(serv)
    case _ => null

}

The problem is I sometimes also pass an additional param on the end of the serv string, so:

var serv = "chat.message"

Is there a way I can match a part of the string so it still gets sent to Chat_Server?

Thanks for any help, much appreciated :)

I have the following:

var serv = "chat"

serv match {
                
    case "chat" => Chat_Server ! Relay_Message(serv)
    case _ => null

}

The problem is that sometimes I also pass an additional param on the end of the serv string, so:

var serv = "chat.message"

Is there a way I can match a part of the string so it still gets sent to Chat_Server?

Thanks for any help, much appreciated :)

edited tags
Link
om-nom-nom
  • 62.9k
  • 13
  • 186
  • 231
Source Link
jahilldev
  • 3.9k
  • 7
  • 39
  • 53
Loading