You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
787 B

function "UCASE" {
param "text";
value "translate($text, 'abcdefghijklmnopqrstuvwxyz-', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_')";
}
function "lcase" {
param "text";
value "translate($text, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ-', 'abcdefghijklmnopqrstuvwxyz_')";
}
function "CamelCase" {
param "text";
choose {
when "contains($text, '-')" {
const "tokens", "str:tokenize($text, '-')";
for "$tokens" {
choose {
when ".='pEp'" > pEp
otherwise {
call "UCASE" with "text", "substring(., 1, 1)";
call "lcase" with "text", "substring(., 2)";
}
}
}
}
otherwise | unsupported
}
}