FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date.

For more details, review the migration guide. Contact support@fauna.com with any questions.

TitleCase

This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics.

TitleCase( value )
titlecase( value )
TitleCase( value )
TitleCase( value )
TitleCase( value )

Description

The TitleCase function returns a string which has the first letter of each word capitalized.

Parameters

Parameter Type Definition and Requirements

value

String

The String having the words capitalized.

Returns

A String which has the first letter of each word capitalized.

Examples

client.query(
  [
    q.TitleCase('JOHN the FiReMan'),
    q.TitleCase('FIRE And FireMan'),
  ]
)
.then((ret) => console.log(ret))
.catch((err) => console.error(
  'Error: [%s] %s: %s',
  err.name,
  err.message,
  err.errors()[0].description,
))
[ 'John The Fireman', 'Fire And Fireman' ]
result = client.query(
  [
    q.titlecase("JOHN the FiReMan"),
    q.titlecase("FIRE And FireMan"),
  ]
)
print(result)
['John The Fireman', 'Fire And Fireman']
result, err := client.Query(
	f.Arr{
		f.TitleCase("JOHN the FiReMan"),
		f.TitleCase("FIRE And FireMan"),
	})

if err != nil {
	fmt.Fprintln(os.Stderr, err)
} else {
	fmt.Println(result)
}
[John The Fireman Fire And Fireman]
try
{
    Value result = await client.Query(
        Arr(
            TitleCase("JOHN the FiReMan"),
            TitleCase("FIRE And FireMan")
        )
    );

    Console.WriteLine(result);
}
catch (Exception e)
{
    Console.WriteLine($"ERROR: {e.Message}");
}
Arr(StringV(John The Fireman), StringV(Fire And Fireman))
[
  TitleCase('JOHN the FiReMan'),
  TitleCase('FIRE And FireMan'),
]
[ 'John The Fireman', 'Fire And Fireman' ]
Query metrics:
  •    bytesIn:  67

  •   bytesOut:  52

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 6ms

  •    retries:   0

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!