LTrim

LTrim( value )
LTrim( value )
LTrim( value )
LTrim( value )
ltrim( value )
LTrim( value )

Description

The LTrim function removes all white spaces, tabs, and newlines from the beginning of the provided string.

Parameters

Argument Type Definition and Requirements

value

The String from which to remove leading spaces, tabs, and newlines.

Returns

A String which has all of the leading white spaces, tabs, and newlines removed.

Examples

The following query executes an array of independent LTrim 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, resulting in "Fire" which becomes the first item in the result array.

  2. The string "\t\n Fire" is processed, resulting in "Fire", which becomes the second item in the result array.

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

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

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