DolphinDB有现成的函数:regexCount 可以统计指定字符的个数。
如:str = ”Aasd,LLLL,xxx“ ; regexCount (str, ",")
regexCount 还支持正则表达式,函数参考地址:
https://dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/r/regexCount.html?highlight=reg
或者可以用,split 函数,做分割后,统计,向量的大小
split(str, ",").size() - 1