morrySnow commented on code in PR #1860: URL: https://github.com/apache/doris-website/pull/1860#discussion_r1921841855
########## docs/sql-manual/sql-functions/scalar-functions/string-functions/sub-replace.md: ########## @@ -22,32 +22,50 @@ specific language governing permissions and limitations under the License. --> -## sub_replace -### Description -#### Syntax +## Description -`VARCHAR sub_replace(VARCHAR str, VARCHAR new_str, INT start[, INT len])` +The `sub_replace` function is used to replace substrings within a string. You can specify the substring to be replaced and the target string to replace it with. It returns a new string where the substring starting from `start` with length `len` in `str` is replaced by `new_str`. If `start` or `len` is a negative integer, it returns NULL. The default value for `len` is the length of `new_str`. -Return with new_str replaces the str with length and starting position from start. -When start and len are negative integers, return NULL. -and the default value of len is the length of new_str. +## Syntax -### example +```sql +sub_replace(<str>, <new_str>, [ ,<start> [ , <len> ] ] +``` + +## Parameters + +| Parameter | Description | +| -- | -- | +| `<str>` | The target string in which the replacement will occur | +| `<new_str>` | The string that will replace the specified substring | +| `<start[, len]>` | start specifies the position where the replacement starts. The optional len specifies the length of the substring to be replaced | Review Comment: start 和 len 要当做两个参数来写 ########## docs/sql-manual/sql-functions/scalar-functions/string-functions/sub-replace.md: ########## @@ -22,32 +22,50 @@ specific language governing permissions and limitations under the License. --> -## sub_replace -### Description -#### Syntax +## Description -`VARCHAR sub_replace(VARCHAR str, VARCHAR new_str, INT start[, INT len])` +The `sub_replace` function is used to replace substrings within a string. You can specify the substring to be replaced and the target string to replace it with. It returns a new string where the substring starting from `start` with length `len` in `str` is replaced by `new_str`. If `start` or `len` is a negative integer, it returns NULL. The default value for `len` is the length of `new_str`. -Return with new_str replaces the str with length and starting position from start. -When start and len are negative integers, return NULL. -and the default value of len is the length of new_str. +## Syntax -### example +```sql +sub_replace(<str>, <new_str>, [ ,<start> [ , <len> ] ] Review Comment: 少了个右括号 ```suggestion sub_replace(<str>, <new_str>, [ ,<start> [ , <len> ] ] ) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org