-3

I was wondering if anyone had advice for creating a function that transformed text_with_spaces into lower camel case like textWithSpaces

I've found a related question on SO, that helps with regular camel case, but I'm not sure how to bring it to lower CamelCase

sfidf12489
  • 121
  • 4

2 Answers2

1

ASSUMING It's just text with spaces,

Here's another answer using REPLACE and SUBSTITUTE:

=REPLACE(SUBSTITUTE(PROPER(TRIM(A1))," ",""),1,1,LEFT(LOWER(TRIM(A1))))

Using REGEX:

=REGEXREPLACE(REGEXREPLACE(PROPER(A1),"\s*",""),"^(\w)",LEFT(LOWER(TRIM(A1))))
TheMaster
  • 45,448
  • 6
  • 62
  • 85
0

If to go from text_with_spaces to textWithSpaces try:

=left(A1)&mid(join("",arrayformula(proper(mid(split(A1,"_"),1,len(A1))))),2,len(A1))

If to go from text with spaces to textWithSpaces try:

=left(A1)&mid(join("",arrayformula(proper(mid(split(A1," "),1,len(A1))))),2,len(A1))

LEFT
MID
JOIN
PROPER
SPLIT
LEN

pnuts
  • 58,317
  • 11
  • 87
  • 139