Skip to content

Commit 46c6552

Browse files
committed
docs: update string function expression example docs
1 parent bc75254 commit 46c6552

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

src/examples/advanced/stringFnExpressions.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import { Example, ExampleCategory, ExampleInfo } from "../Example"
1111
* This example shows how to use string functions within expressions.
1212
*
1313
* The following string functions are supported:
14-
* - replace(searchRegexp, replacement)
15-
* - replaceAll(searchRegexp, replacement)
16-
* - slice(start, end)
17-
* - substring(start, end)
18-
* - trimStart()
19-
* - trimEnd()
20-
* - trim()
21-
* - toUpperCase()
22-
* - toLowerCase()
14+
* - `replace(searchRegexp, replacement)`: Replaces the first occurrence of a pattern matching the regular expression with a replacement string. See [`String.prototype.replace()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace).
15+
* - `replaceAll(searchRegexp, replacement)`: Replaces all occurrences of a pattern matching the regular expression with a replacement string. See [`String.prototype.replaceAll()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll).
16+
* - `slice(start, end)`: Extracts a section of a string and returns it as a new string, without modifying the original string. See [`String.prototype.slice()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice).
17+
* - `substring(start, end)`: Returns the part of the string between the start and end indexes, or to the end of the string. See [`String.prototype.substring()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring).
18+
* - `trimStart()`: Removes whitespace from the beginning of a string. See [`String.prototype.trimStart()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart).
19+
* - `trimEnd()`: Removes whitespace from the end of a string. See [`String.prototype.trimEnd()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd).
20+
* - `trim()`: Removes whitespace from both ends of a string. See [`String.prototype.trim()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim).
21+
* - `toUpperCase()`: Converts a string to uppercase letters. See [`String.prototype.toUpperCase()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase).
22+
* - `toLowerCase()`: Converts a string to lowercase letters. See [`String.prototype.toLowerCase()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase).
2323
*/
2424
export const info: ExampleInfo = {
2525
name: "stringFnExpressions",
@@ -28,6 +28,7 @@ export const info: ExampleInfo = {
2828
"This example demonstrates how to use string function expressions in the configuration.",
2929
category: ExampleCategory.ADVANCED,
3030
discussions: [549],
31+
pullRequests: [556],
3132
skipGenerate: [],
3233
}
3334
export const initConfig: E2EInitConfig = {

src/gas/examples/advanced/stringFnExpressions-test.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ function stringFnExpressionsTestConfig() {
77
* This example shows how to use string functions within expressions.
88
*
99
* The following string functions are supported:
10-
* - replace(searchRegexp, replacement)
11-
* - replaceAll(searchRegexp, replacement)
12-
* - slice(start, end)
13-
* - substring(start, end)
14-
* - trimStart()
15-
* - trimEnd()
16-
* - trim()
17-
* - toUpperCase()
18-
* - toLowerCase()
10+
* - `replace(searchRegexp, replacement)`: Replaces the first occurrence of a pattern matching the regular expression with a replacement string. See [`String.prototype.replace()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace).
11+
* - `replaceAll(searchRegexp, replacement)`: Replaces all occurrences of a pattern matching the regular expression with a replacement string. See [`String.prototype.replaceAll()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll).
12+
* - `slice(start, end)`: Extracts a section of a string and returns it as a new string, without modifying the original string. See [`String.prototype.slice()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice).
13+
* - `substring(start, end)`: Returns the part of the string between the start and end indexes, or to the end of the string. See [`String.prototype.substring()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring).
14+
* - `trimStart()`: Removes whitespace from the beginning of a string. See [`String.prototype.trimStart()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart).
15+
* - `trimEnd()`: Removes whitespace from the end of a string. See [`String.prototype.trimEnd()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd).
16+
* - `trim()`: Removes whitespace from both ends of a string. See [`String.prototype.trim()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim).
17+
* - `toUpperCase()`: Converts a string to uppercase letters. See [`String.prototype.toUpperCase()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase).
18+
* - `toLowerCase()`: Converts a string to lowercase letters. See [`String.prototype.toLowerCase()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase).
1919
*/
2020
const info = {
2121
name: "stringFnExpressions",
@@ -24,6 +24,7 @@ function stringFnExpressionsTestConfig() {
2424
"This example demonstrates how to use string function expressions in the configuration.",
2525
category: "advanced",
2626
discussions: [549],
27+
pullRequests: [556],
2728
skipGenerate: [],
2829
}
2930
const initConfig = {

0 commit comments

Comments
 (0)