RTrim

RTrim( value )
RTrim( value )
RTrim( value )
RTrim( value )
rtrim( value )
RTrim( value )

Description

The RTrim function removes all trailing white spaces, tabs, and new lines from the end of a string.

Parameters

Argument Type Definition and Requirements

value

The string which should have its trailing white spaces, tabs, and new lines removed.

Returns

A string which has all of the trailing white spaces, tabs, and new lines removed.

Examples

The following query executes an array of independent RTrim operations and returns the results in an array. The result array position matches the execution array position. The individual operations are:

  1. The string `Fire ` is processed, removing the trailing space. The result string "Fire" is placed in the top position of the result array.

  2. The string Fire\n\n\t\t , which contains embedded tabs, new lines, and spaces at the end of the string, is processed. The result string Fire is placed in the second position of the result array.

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

Console.WriteLine(result);
Arr(StringV(Fire), StringV(Fire))
result, err := client.Query(
	f.Arr{
		f.RTrim("Fire    "),
		f.RTrim("Fire\n\n\t\t  "),
	})

if err != nil {
	fmt.Fprintln(os.Stderr, err)
} else {
	fmt.Println(result)
}
[Fire Fire]
System.out.println(
    client.query(
        Arr(
            RTrim("Fire    "),
            RTrim("Fire\n\n\t\t  ")
        )
    ).get());
["Fire", "Fire"]
client.query(
  [
    q.RTrim('Fire    '),
    q.RTrim('Fire\n\n\t\t  '),
  ]
)
.then((ret) => console.log(ret))
.catch((err) => console.error('Error: %s', err))
[ 'Fire', 'Fire' ]
result = client.query(
  [
    q.rtrim("Fire    "),
    q.rtrim("Fire\n\n\t\t  "),
  ]
)
print(result)
['Fire', 'Fire']
println(Await.result(
    client.query(
        Arr(
            RTrim("Fire    "),
            RTrim("Fire\n\n\t\t  ")
        )
    ),
    5.seconds
))
["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!