This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: strings exprs support ToUpper and ToLower function (#364)
* feat: strings exprs support ToUpper and ToLower function Signed-off-by: Viet-Anh Duong <[email protected]> * docs: add ToLower and ToUpper document Signed-off-by: Viet-Anh Duong <[email protected]>
- Loading branch information
1 parent
de62f9e
commit bd5c215
Showing
3 changed files
with
84 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
package strings | ||
|
||
import "strings" | ||
import ( | ||
"strings" | ||
) | ||
|
||
func NewExprs() map[string]interface{} { | ||
return map[string]interface{}{ | ||
"ReplaceAll": replaceAll, | ||
"ToUpper": toUpper, | ||
"ToLower": toLower, | ||
} | ||
} | ||
|
||
func replaceAll(s, old, new string) string { | ||
return strings.ReplaceAll(s, old, new) | ||
} | ||
|
||
func toUpper(s string) string { | ||
return strings.ToUpper(s) | ||
} | ||
|
||
func toLower(s string) string { | ||
return strings.ToLower(s) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters