0

Basically I've two strings Says: String a = "How are you", String b = "john".

Now I need to transfer these 2 Strings to a client with a character that the client could understand that a and b contains 2 different values. I can't use any keyboard available characters in order to split them in client side. Based on looking on ASCII Table I found the most suitable character would be ETX (End Of Text).

Example for to separate a line you would use:

String a="How are you"+System.lineSeparator()+"john"

(FYI: Can't use lineSeparator) My Need:

String a="How are you"+ETX+"john"

So I would really appreciate if some one tell me how to add ETX to a string and then use split to split the string.

Regards

2
  • 1
    If you can choose the character, it seems you control enough of the protocol and could also choose a more flexible/common wire format. For example ["How are you", "john"] (JSON) Commented Jan 22, 2017 at 11:18
  • 1
    This answer to the duplicate question may be of particular interest. Commented Jan 22, 2017 at 11:19

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.