第一种方法:使用strip函数
第二种方法:使用regexReplace函数,配合正则表达式实现
regexReplace("abc \t 123 \n 456 789","\\s+","")
替换前效果
替换后效果
第二种方法:如果使用上述正则表达式无法去掉某些特殊的空白字符,可以将其print到控制台,复制粘贴的方式使用strReplace函数将其替换掉
参考链接:
regexReplace:https://www.dolphindb.cn/cn/help/FunctionsandCommands/FunctionReferences/r/regexReplace.html
strReplace:https://www.dolphindb.cn/cn/help/FunctionsandCommands/FunctionReferences/s/strReplace.html