Yep, the function can only take string with characters as a input for encoding, with integers it becomes quite complicated but doable by using some special characters like "$" or "#" and it must be guaranteed that the said special character won't be used.
Your method is actually a much smarter way of achieving it! Thanks for the tip :)
I have mixed feelings when being complimented over this code since I've abused loose type coercion of Javascript when joining characters and numbers, not to mention the nasty xs[xs.Length-1]++ thing; both should be used as an example of how dangerous the language is.
As for your first paragraph, there is no need for any guarantees. In such cases, some escape sequence is typically used. It is similar to "one line \n second line" vs "one line \\n no second line". You just have to double your special character.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yep, the function can only take string with characters as a input for encoding, with integers it becomes quite complicated but doable by using some special characters like "$" or "#" and it must be guaranteed that the said special character won't be used.
Your method is actually a much smarter way of achieving it! Thanks for the tip :)
Thank you.
I have mixed feelings when being complimented over this code since I've abused loose type coercion of Javascript when joining characters and numbers, not to mention the nasty xs[xs.Length-1]++ thing; both should be used as an example of how dangerous the language is.
As for your first paragraph, there is no need for any guarantees. In such cases, some escape sequence is typically used. It is similar to "one line \n second line" vs "one line \\n no second line". You just have to double your special character.