Transform Reference
String & Case Conversion Verbs
Concatenation, extraction, padding, masking, and case conversion verbs for string manipulation.
String Manipulation
| Verb | Syntax | Description | Try It |
|---|---|---|---|
| concat | %concat @p1 "sep" @p2 | Concatenate values | Try |
| upper | %upper @path | Uppercase | Try |
| lower | %lower @path | Lowercase | Try |
| capitalize | %capitalize @path | Capitalize first letter | Try |
| titleCase | %titleCase @path | Title Case Each Word | Try |
| trim | %trim @path | Remove leading/trailing whitespace | Try |
| substring | %substring @path start len | Extract substring (0-based) | Try |
| replace | %replace @path "find" "repl" | Replace all occurrences | Try |
| padLeft | %padLeft @path len "char" | Left-pad to length | Try |
| padRight | %padRight @path len "char" | Right-pad to length | Try |
| truncate | %truncate @path len | Truncate to max length | Try |
| mask | %mask @path "pattern" | Apply format mask (# = digit) | Try |
| split | %split @path "delim" index | Split and take element | Try |
| join | %join @array "delim" | Join array elements | Try |
| length | %length @path | String length | Try |
| contains | %contains haystack needle | Check if string contains substring | Try |
| formatPhone | %formatPhone @value "countryCode" | Format phone number by country code | Try |
Case Conversion
| Verb | Syntax | Description | Try It |
|---|---|---|---|
| camelCase | %camelCase @path | Convert to camelCase (helloWorld) | Try |
| snakeCase | %snakeCase @path | Convert to snake_case (hello_world) | Try |
| kebabCase | %kebabCase @path | Convert to kebab-case (hello-world) | Try |
| pascalCase | %pascalCase @path | Convert to PascalCase (HelloWorld) | Try |
| slugify | %slugify @path | Convert to URL-safe slug | Try |
Reference
Phone Formatting (formatPhone) — Country Codes
Strips non-digit characters from input, then applies the country-specific format. Returns null if digit count doesn't match.
| Code | Country | Digits | Format | Example |
|---|---|---|---|---|
US | United States | 10 | (XXX) XXX-XXXX | (512) 555-1234 |
CA | Canada | 10 | (XXX) XXX-XXXX | (416) 555-1234 |
GB | United Kingdom | 10 | +44 XX XXXX XXXX | +44 20 7123 4567 |
DE | Germany | 10-11 | +49 XXX XXXXXXX | +49 30 1234567 |
FR | France | 9 | +33 X XX XX XX XX | +33 1 23 45 67 89 |
AU | Australia | 9 | +61 X XXXX XXXX | +61 2 1234 5678 |
JP | Japan | 10 | +81 X-XXXX-XXXX | +81 3-1234-5678 |
If no country code is provided or unrecognized, returns digits as-is.
Examples
String verb examples
; Concatenation
full_name = %concat @name.first " " @name.last ; "John Smith"
; Case conversion
state = %upper @address.state ; "tx" -> "TX"
name = %capitalize @name.first ; "john" -> "John"
; Substring / replace
area_code = %substring @phone ##0 ##3 ; "5125551234" -> "512"
no_dashes = %replace @ssn "-" "" ; "123-45-6789" -> "123456789"
; Pad / truncate
seq = %padLeft @sequence ##5 "0" ; "42" -> "00042"
short = %truncate @description ##20 ; Limit to 20 chars
; Mask
phone = %mask @phone "###-###-####" ; "5125551234" -> "512-555-1234"
; Phone formatting
us = %formatPhone @phone "US" ; "5125551234" -> "(512) 555-1234"
uk = %formatPhone @phone "GB" ; "2071234567" -> "+44 20 7123 4567"