added Util.nullTerminatedCharArrayToString
This commit is contained in:
parent
febe5786b9
commit
edd4b2bc56
|
@ -0,0 +1,14 @@
|
|||
package com.danitheskunk.skunkworks;
|
||||
|
||||
public class Util {
|
||||
public static String nullTerminatedCharArrayToString(char[] chars) {
|
||||
int len = chars.length;
|
||||
for(int i = 0; i < chars.length; ++i) {
|
||||
if(chars[i] == '\0') {
|
||||
len = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new String(chars, 0, len);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue