1
如何从字符串中删除十六进制高值?例如。在我的数据库中名称存储在十六进制高值(ŸŸŸŸŸŸŸŸŸACB
)中,我需要删除ŸŸŸŸŸŸŸŸŸ
并且只能得到ABC
。如何从字符串中删除十六进制高值?
如何从字符串中删除十六进制高值?例如。在我的数据库中名称存储在十六进制高值(ŸŸŸŸŸŸŸŸŸACB
)中,我需要删除ŸŸŸŸŸŸŸŸŸ
并且只能得到ABC
。如何从字符串中删除十六进制高值?
String result = value.replaceAll("[^\x20-\x7e]", "");
public static String trimCharacters(String strToBeTrimmed)
{
strToBeTrimmed = strToBeTrimmed.replaceAll("\\x00", null); // remove all NULLs
// similar for the others
// this always comes last
strToBeTrimmed = strToBeTrimmed.replaceAll("\\s{20}",null); // remove whitespace in 20-char chunks
return strToBeTrimmed;
}
“十六进制高”?你的意思是只保留十六进制字符? –
它只是一个字符串,所以使用你的数据库的字符串操作...? –
也许给我们一些更多的示例输入和输出。 –