Button handy |
---|
blank | true |
---|
color | #0052CC |
---|
name | Send Feedback |
---|
link | https://docs.google.com/forms/d/e/1FAIpQLScmToBe3vynAlb5fdKwCGxYqnTbDc66sIBgeecG2BuFDuHc7g/viewform?entry.2002826954=Camel+case+function+-+1222738204 |
---|
width | auto |
---|
|
Excerpt |
---|
hidden | true |
---|
name | description |
---|
|
Function to convert a text string containing a single or multiple words into a camel case test string. |
...
Code Block |
---|
function camelCase(string name) {
string [] words = split(name, " ");
string cc = toLower(words[0]);
for(int x=1; x<size(words); x++) {
string nextWord;
for(int l=0; l<length(words[x]); l++) {
if(l==0) {
nextWord = toUpper(words[x][l]);
} else {
nextWord += words[x][l];
}
}
cc += nextWord;
}
return cc;
}
return camelCase("I love using Power Scripts");
//returns iLoveUsingPowerScripts |
We've encountered an issue exporting this macro. Please try exporting this page again later.