Space

Space( count )
Space( count )
Space( count )
Space( count )
space( count )
Space( count )

Description

The Space function returns a string of the specified number of spaces.

Parameters

Parameter Type Definition and Requirements

count

The Number of spaces to be returned.

Returns

A String which has the specified number of spaces.

Examples

The following query executes an array of independent Space operations and returns the results in an array. The result array position matches the execution array position. The first operation takes the count of 1 and returns a string with a single space, placing it in the top position of the result array. The second operation calls Space with a count of 20 and returns a string of 20 spaces, placing it in the second position of the result array:

try
{
    Value result = await client.Query(
        Arr(
            Space(1),
            Space(20)
        )
    );

    Console.WriteLine(result);
}
catch (Exception e)
{
    Console.WriteLine($"ERROR: {e.Message}");
}
Arr(StringV( ), StringV(                    ))
result, err := client.Query(
	f.Arr{
		f.Space(1),
		f.Space(20),
	})

if err != nil {
	fmt.Fprintln(os.Stderr, err)
} else {
	fmt.Println(result)
}
[                      ]
System.out.println(
    client.query(
        Arr(
            Space(1),
            Space(20)
        )
    ).get());
[" ", "                    "]
client.query(
  [
    q.Space(1),
    q.Space(20),
  ]
)
.then((ret) => console.log(ret))
.catch((err) => console.error(
  'Error: [%s] %s: %s',
  err.name,
  err.message,
  err.errors()[0].description,
))
[ ' ', '                    ' ]
result = client.query(
  [
    q.space(1),
    q.space(20),
  ]
)
print(result)
[' ', '                    ']
[
  Space(1),
  Space(20),
]
[ ' ', '                    ' ]
Query metrics:
  •    bytesIn:  26

  •   bytesOut:  41

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 5ms

  •    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!