"1.1" + "1.1" = "1.11.1"
(+"1.1") + (+"1.1") = 2.2 // Note: the parentheses are added for clarity, not required.
在字符串前面加上“+”符号,这里加上括号是为了看清楚表达式,括号不是必须的。
字符串转换成数字类型的另一种方法
最新推荐文章于 2023-11-04 15:46:46 发布
"1.1" + "1.1" = "1.11.1"
(+"1.1") + (+"1.1") = 2.2 // Note: the parentheses are added for clarity, not required.
在字符串前面加上“+”符号,这里加上括号是为了看清楚表达式,括号不是必须的。