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

String

The string having the leading white spaces, tabs, and new lines removed.

Returns

A string value which has both the leading and trailing white spaces, tabs, and new lines removed.

Examples

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

Console.WriteLine(result);
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']
println(Await.result(
    client.query(
        Arr(
            Trim("Fire   "),
            Trim("    Fire    "),
            Trim("    \n\n\t\tFire\n\n\t\t    ")
        )
    ),
    5.seconds
))
["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!