我在java 8中遇到了以下问题
import java.util.*;
import java.text.*;
import java.lang.*;
class NumberTest5 {
public static void main(String[] args) {
Locale loc = new Locale("sr","ME");
DecimalFormat df = (DecimalFormat)NumberFormat.getCurrencyInstance(loc);
System.out.println("\n"+"currencySymbol:"+df.getPositivePrefix()+"\tlength:"+df.getPositivePrefix().length());
//here the above result is currencySymbol: €+(non breakable space char)
//length:2
}
}
Run Code Online (Sandbox Code Playgroud)
真正的问题是为什么货币符号附加了额外的字符..?
为什么上述程序以这种方式表现......?
它有什么问题以及如何纠正它?
谢谢
java ×1