Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
The REPLICATE function returns a string value repeated a specific number of times.
An Azure Cosmos DB for NoSQL system function that returns a string value repeated a specific number of times.
Syntax
REPLICATE(<string_expr>, <numeric_expr>)
Arguments
| Description | |
|---|---|
string_expr |
A string expression. |
numeric_expr |
A numeric expression. |
Return types
Returns a string expression.
Examples
This section contains examples of how to use this query language construct.
Repeat string value
In this example, the function builds a repeating string.
SELECT VALUE {
catchPhrase: REPLICATE("Cosmic", 3)
}
[
{
"catchPhrase": "CosmicCosmicCosmic"
}
]
Remarks
- This function doesn't utilize the index.
- The maximum length of the result is 10,000 characters. -
(length(string_expr) * numeric_expr) <= 10,000 - If
numeric_expris negative or nonfinite, the result isundefined.