Skip to content

Commit fa0da58

Browse files
committed
Remove carriage return
1 parent 34c4c25 commit fa0da58

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

codec2talkie/src/main/java/com/radio/codec2talkie/tools/TextTools.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,14 @@ public static String getString(ByteBuffer byteBuffer) {
4545
while (byteBuffer.hasRemaining()) {
4646
byte b = byteBuffer.get();
4747
char c = charset.decode(ByteBuffer.wrap(new byte[]{b})).toString().charAt(0);
48-
if (c == '\r') continue;
4948
if (c == '\n') {
5049
break;
5150
}
5251
result.append(c);
5352
}
5453
byteBuffer.compact();
5554
}
56-
return result.toString();
55+
return result.toString().replaceAll("[\\r\\n]+$", "");
5756
}
5857

5958
public static byte[] hexStringToByteArray(String s) {

0 commit comments

Comments
 (0)