我想知道是否有人建议创建一个将text_with_spaces转换为较低驼峰情况的函数,如textWithSpaces
I've found a related question on SO,这有助于常规的驼峰案例,但我不确定如何将其降低到较低的CamelCase
答案 0 :(得分:1)
假设它只是带空格的文本,
以下是使用REPLACE
和SUBSTITUTE
的另一个答案:
=REPLACE(SUBSTITUTE(PROPER(TRIM(A1))," ",""),1,1,LEFT(LOWER(TRIM(A1))))
使用REGEX:
=REGEXREPLACE(REGEXREPLACE(PROPER(A1),"\s*",""),"^(\w)",LEFT(LOWER(TRIM(A1))))
答案 1 :(得分:0)