I understand that this code in C# is trying to remove nul
characters (\0
) from a string.
string.Join("", mText.Split(new string[] { "\0" }, StringSplitOptions.None));
Is there any way to do that efficiently in Java?
I understand that this code in C# is trying to remove nul
characters (\0
) from a string.
string.Join("", mText.Split(new string[] { "\0" }, StringSplitOptions.None));
Is there any way to do that efficiently in Java?
In Java 8+ you could use
StringJoiner
and a lambda expression likeOutput is
You can write: