substring 无法编译,该如何解决
substring 无法编译Java codedollars Long.parseLong(stringAmount, substring(0,length-3))cents Lo
substring 无法编译
Java codedollars = Long.parseLong(stringAmount, substring(0,length-3));cents = Long.parseInt(stringAmount, substring(length-2,length));
substring 都为小写,,,,但是上下两个substring都画着红线无法编译,,显示无法编译,,
试问一下这是为什么啊?
谢谢
[解决办法]dollars = Long.parseLong(stringAmount, substring(0,length-3));
cents = Long.parseInt(stringAmount, substring(length-2,length));
替换成
dollars = Long.parseLong(stringAmount.substring(0,length-3));
cents = Long.parseInt(stringAmount.substring(length-2,length));
逗号换成.
。。。