hotfix: replace cloud strings.substring with duplicate oss shortcode

pull/1946/head
Scott Anderson 2020-12-04 09:49:13 -07:00
parent dd2833d5dd
commit 0b7949c9b0
1 changed files with 1 additions and 43 deletions

View File

@ -12,46 +12,4 @@ menu:
weight: 301
---
The `strings.substring()` function returns a substring based on `start` and `end` parameters.
These parameters are represent indices of UTF code points in the string.
_**Output data type:** String_
```js
import "strings"
strings.substring(v: "influx", start: 0, end: 3)
// returns "infl"
```
## Parameters
### v
The string value to search.
_**Data type:** String_
### start
The starting index of the substring.
_**Data type:** Integer_
### end
The ending index of the substring.
_**Data type:** Integer_
## Examples
###### Store the first four characters of a string
```js
import "strings"
data
|> map(fn: (r) => ({
r with
abbr: strings.substring(v: r.name, start: 0, end: 3)
})
)
```
{{< duplicate-oss >}}