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;
}
「十六進制高」?你的意思是隻保留十六進制字符? –
它只是一個字符串,所以使用你的數據庫的字符串操作...? –
也許給我們一些更多的示例輸入和輸出。 –