HomeGuides
Try a DemoGet the Latest ReleaseSee the CHANGELOGCreate a Feature Request / Bug ReportJoin the Conversation
Guides

String

String transforms operate on string data.

string.append

Appends (suffixes) a substring to string data.

Settings

FieldTypeDescriptionRequired
object.source_keystringRetrieves a value from an object for transformation.No
object.target_keystringSets a value into an object after transformation.No
suffixstringString value that is appended to the data.Yes

Example

sub.transform.string.append(
  settings={object: {source_key: 'str', target_key: 'str'}, suffix: '\n'}
)
sub.tf.str.append({obj: {src: 'str', trg: 'str'}, suffix: '\n'})

string.capture

Captures one or more substrings using a regular expression pattern. This transform can produce a single capture (as a string), many captures (as an array), and an object (using a named capture group).

If configured to capture more than one substring, then the result is a JSON array, otherwise the result is a string.

Settings

FieldTypeDescriptionRequired
object.source_keystringRetrieves a value from an object for transformation.No
object.target_keystringPlaces a value into an object after transformation.No
patternstringRegular expression pattern used to capture substrings.Yes
countintegerNumber of captures to make. If configured, then the result is a JSON array.

Defaults to 0.
No

Example

sub.transform.string.capture(
  settings={object: {source_key: 'str', target_key: 'str'}, pattern: '^(.*)$'}
)
sub.tf.str.match.find({obj: {src: 'str', trg: 'str'}, pattern: '^(.*)$'})

string.replace

Replaces characters in string data.

Settings

FieldTypeDescriptionRequired
object.source_keystringRetrieves a value from an object for transformation.No
object.target_keystringPlaces a value into an object after transformation.No
patternstringRegular expression pattern used to identify values to replace.Yes
replacementstringString value that replaces the matched data.Yes

Example

sub.transform.string.replace(
  settings={object: {source_key: 'str', target_key: 'str'}, pattern: 'c', replacement: 'b'}
)
sub.tf.str.replace({obj: {src: 'str', trg: 'str'}, pattern: 'c', replacement: 'b'})

string.split

Splits a string into a JSON array.

This is the opposite of the Array transform array_join.

Settings

FieldTypeDescriptionRequired
object.source_keystringRetrieves a value from an object for transformation.No
object.target_keystringPlaces a value into an object after transformation.No
separatorstringSeparator substring that is used to split values.Yes

Example

sub.transform.string.split(
  settings={object: {source_key: 'str', target_key: 'str'}, separator: '.'}
)
sub.tf.str.split({obj: {src: 'str', trg: 'str'}, separator: '.'})

string.to.lower

Converts a string to lowercase (downcase).

Settings

FieldTypeDescriptionRequired
object.source_keystringRetrieves a value from an object for transformation.No
object.target_keystringPlaces a value into an object after transformation.No

Example

sub.transform.string.to.lower(
  settings={object: {source_key: 'str', target_key: 'str'}}
)
sub.tf.str.to.lower({obj: {src: 'str', trg: 'str'}})

string.to.upper

Converts a string to uppercase (upcase).

Settings

FieldTypeDescriptionRequired
object.source_keystringRetrieves a value from an object for transformation.No
object.target_keystringPlaces a value into an object after transformation.No

Example

sub.transform.string.to.upper(
  settings={object: {source_key: 'str', target_key: 'str'}}
)
sub.tf.str.to.upper({obj: {src: 'str', trg: 'str'}})

string.to.snake

Converts a string to snake case.

Settings

FieldTypeDescriptionRequired
object.source_keystringRetrieves a value from an object for transformation.No
object.target_keystringPlaces a value into an object after transformation.No

Example

sub.transform.string.to.snake(
  settings={object: {source_key: 'str', target_key: 'str'}}
)
sub.tf.str.to.snake({obj: {src: 'str', trg: 'str'}})

string.uuid

Generates a UUIDv4 string.

Settings

FieldTypeDescriptionRequired
object.target_keystringPlaces a value into an object after transformation.No

Example

sub.transform.string.uuid(
  settings={object: {target_key: 'uuid'}}
)
sub.tf.str.uuid({obj: {trg: 'uuid'}})