Mujtaba Aldebes
Mujtaba Aldebes

Reputation: 143

Read socket string java

i get <CreateRoom Name='room nam' Mode='2v2/single' Players='4/10'/> as a TCP socket call and i want to parse and get the tags. I solved it with strip, replace and startsWith But is there a easier way or a correct way to extract the tags?

Thanks in advance.

Upvotes: 0

Views: 36

Answers (1)

flyingfox
flyingfox

Reputation: 13506

You can regard it as XML and use frameworks such as dom4j to parse it.

Upvotes: 1

Related Questions