Trim

Trim( value )
Trim( value )
Trim( value )
Trim( value )
trim( value )
Trim( value )

Description

The Trim function returns a string which has both the leading and trailing white spaces, tabs, and new lines removed from the string.

Parameters

Argument Type Definition and Requirements

value

The string that should have any leading and trailing white spaces, tabs, and newlines removed.

Returns

A String which has both the leading and trailing white spaces, tabs, and newlines removed.

Examples

try
{
    Value result = await client.Query(
        Arr(
            Trim("Fire   "),
            Trim("    Fire    "),
            Trim("    \n\n\t\tFire\n\n\t\t    ")
        )
    );

    Console.WriteLine(result);
}
catch (Exception e)
{
    Console.WriteLine($"ERROR: {e.Message}");
}
Arr(StringV(Fire), StringV(Fire), StringV(Fire))
result, err := client.Query(
	f.Arr{
		f.Trim("Fire   "),
		f.Trim("    Fire    "),
		f.Trim("    \n\n\t\tFire\n\n\t\t    "),
	})

if err != nil {
	fmt.Fprintln(os.Stderr, err)
} else {
	fmt.Println(result)
}
[Fire Fire Fire]
System.out.println(
    client.query(
        Arr(
            Trim("Fire   "),
            Trim("    Fire    "),
            Trim("    \n\n\t\tFire\n\n\t\t    ")
        )
    ).get());
["Fire", "Fire", "Fire"]
client.query(
  [
    q.Trim('Fire   '),
    q.Trim('    Fire    '),
    q.Trim('    \n\n\t\tFire\n\n\t\t    '),
  ]
)
.then((ret) => console.log(ret))
.catch((err) => console.error('Error: %s', err))
[ 'Fire', 'Fire', 'Fire' ]
result = client.query(
  [
    q.trim("Fire   "),
    q.trim("    Fire    "),
    q.trim("    \n\n\t\tFire\n\n\t\t    "),
  ]
)
print(result)
['Fire', 'Fire', 'Fire']
try {
  println(Await.result(
    client.query(
        Arr(
            Trim("Fire   "),
            Trim("    Fire    "),
            Trim("    \n\n\t\tFire\n\n\t\t    ")
        )
    ),
    5.seconds
))} catch {
  case unknown: Throwable => println("Error: " + unknown.getMessage())
}
["Fire", "Fire", "Fire"]

Was this article helpful?

We're sorry to hear that.
Tell us how we can improve!
Visit Fauna's Discourse forums or email docs@fauna.com

Thank you for your feedback!