看到一个这样子的面试题: 给String对象添加一个方法,传入一个string类型的参数,然后将string的每一个字符间加空格返回,例如:addSpace("hello world") //->'h e l l o w o r l d'. 第一眼看这道题目觉得出的很有问题, 既然给String中添加对象,调用方法应该是str.addSpace(),addSpace(str)是一个普通函数的调用方法吧! 请教了下别人,发现自己思维有点误区,直接就考虑到了给String原型添加对象
spring applicationContext_datasource.xml中约束错误 org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1 in XML document from URL [file:/D:/eclipse/workspace/erp_parent/erp_dao/target/classes/applicationContext_datasource.xml] is
为了更加直观,有些号码需要加空格: // 拼接空格,每4位加一个空格 let bankAccount = '6228888888888888888'; let blank_value = bankAccount.replace(/\s/g,'').replace(/(.{4})/g,"$1 ").trim(); console.log(blank_value); 字符串去中间空格: // 字符串去中间空格 let value = 'ab cd efg'; let temp = valu