Skip to main content

Text Transformation

Inserts the selected text transformed by the specified transformation.

Parameters

1️⃣ Transformation (default: Upper Case)

The transformation that will be applied to the selected text.

There are predefined transformations:

  • Start Upper Case: hello world -> Hello world
  • Start Lower Case: HELLO WORLD -> hELLO WORLD
  • Upper Case: hello world -> HELLO WORLD
  • Lower Case: HELLO WORLD -> hello world
  • Title Case: hello world -> Hello World
  • Sentence Case: hello world! how are you? -> Hello world! How are you?
  • Camel Case: hello world -> helloWorld
  • Pascal Case: hello world -> HelloWorld
  • Snake Case: hello world -> hello_world
  • Join Lines: hello\nworld -> hello world
  • Split Lines by Space: hello world -> hello\nworld
  • Sort Lines: world\nhello -> hello\nworld
  • Remove Empty Lines: hello\n\nworld -> hello\nworld

Syntax

{@text-transform|Camel Case@}

Use Cases

This placeholder is useful when you want to reuse the selected text but in a different format.

Example 1

You want to reuse the same name in different parts of your template, which requires the name to be in different formats.

Dear Supplier,

Could you please send us the most recent price list for {@selection-content@}?

{@text-transform|Start Upper Case@} are in high demand and we need
to update our prices.

Best regards,
Purchasing Department

Example 2

You want to create a snippet that generates a template to test a class with the selected name. In this case, usually you need to reuse the class name in different formats.

final class {@text-transform|Pascal Case@}Tests: XCTestCase {
private var {@text-transform|Camel Case@}: {@text-transform|Pascal Case@}!

override func setUp() {
super.setUp()

{@text-transform|Camel Case@} = {@text-transform|Pascal Case@}()
}
}