TheMotivatedGeek
TheMotivatedGeek

Reputation: 25

Splitting a String at Char in Painless Scripting Language

I am trying to split a String (that represents an IPv4 address) in painless. I tried the following:

String[] ipAddressParts = /\\./.split(params.ip);

But the String doesn't get split at all.

Upvotes: 1

Views: 2009

Answers (1)

Val
Val

Reputation: 217424

You're almost there, the correct code is this one (you have one too many backslashes):

String[] ipAddressParts = /\./.split(params.ip);

Upvotes: 4

Related Questions