Forum Discussion
7 Replies
- petar_rajchinosNew Contributor III
Hi cstwart,
In order to use the new features you should probably upgrade your snaplex to the newest version.
- jovan_jNew Contributor III
Hi cstwart,
You could also use the following expression: “test upper case”.replace(/\b\w/g, chr => chr.toUpperCase())
- cjhoward18Employee
Sure, but in your example that is not really camel case. it should result in a string that looks like this:
“testUpperCase”Also, the camelCase method will be able to convert all sorts of strings into camel case. not just ones seperated by spaces. for example:
“foo–bar”.camelCase() → fooBar
“foo**bar”.camelCase() ->fooBar
so if the use case is for special characters as well as spaces, I’d use the camelCase method
- jovan_jNew Contributor III
Hi cjhoward18,
To achieve this you could extend your expression: “test camel-case+&^%$#@!*to=upper”.replace(/\b\w/g, chr => chr.toUpperCase()).replace(/[^a-zA-Z0-9]/g, “”)
- cstewartFormer Employee
In the expression language from the May 2019 (4.17) release you can.
See https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439357/String+Functions+and+Properties#StringFunctionsandProperties-camelcase- subhash_a_chandNew Contributor
Hi cstwart,
I found this documentation but looks like its not incorporated in mapper as we get “method not found error”.