mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
doc: add docment for UpperCamelCase
This commit is contained in:
1 parent
cf1b27a35a
commit
747dddee8b
5 files changed
+5
-5
No files matched your search
@@ -1997,7 +1997,7 @@ import "github.com/duke-git/lancet/v2/strutil"
|
|||||||
[[play](https://go.dev/play/p/9eXP3tn2tUy)]
|
[[play](https://go.dev/play/p/9eXP3tn2tUy)]
|
||||||
- **<big>UpperCamelCase</big>** : coverts source string to its UpperCamelCase string.
|
- **<big>UpperCamelCase</big>** : coverts source string to its UpperCamelCase string.
|
||||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#UpperCamelCase)]
|
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#UpperCamelCase)]
|
||||||
[[play](https://go.dev/play/p/todo)]
|
[[play](https://go.dev/play/p/vPHszjTXSFp)]
|
||||||
- **<big>Capitalize</big>** : converts the first character of source string to upper case and the remaining to lower case.
|
- **<big>Capitalize</big>** : converts the first character of source string to upper case and the remaining to lower case.
|
||||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#Capitalize)]
|
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#Capitalize)]
|
||||||
[[play](https://go.dev/play/p/2OAjgbmAqHZ)]
|
[[play](https://go.dev/play/p/2OAjgbmAqHZ)]
|
||||||
|
|||||||
+1
-1
@@ -2004,7 +2004,7 @@ import "github.com/duke-git/lancet/v2/strutil"
|
|||||||
[[play](https://go.dev/play/p/9eXP3tn2tUy)]
|
[[play](https://go.dev/play/p/9eXP3tn2tUy)]
|
||||||
- **<big>UpperCamelCase</big>** : 将字符串转换为CamelCase大写驼峰式字符串, 非字母和数字会被忽略。
|
- **<big>UpperCamelCase</big>** : 将字符串转换为CamelCase大写驼峰式字符串, 非字母和数字会被忽略。
|
||||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#UpperCamelCase)]
|
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#UpperCamelCase)]
|
||||||
[[play](https://go.dev/play/p/todo)]
|
[[play](https://go.dev/play/p/vPHszjTXSFp)]
|
||||||
- **<big>Capitalize</big>** : 将字符串的第一个字符转换为大写。
|
- **<big>Capitalize</big>** : 将字符串的第一个字符转换为大写。
|
||||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#Capitalize)]
|
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#Capitalize)]
|
||||||
[[play](https://go.dev/play/p/2OAjgbmAqHZ)]
|
[[play](https://go.dev/play/p/2OAjgbmAqHZ)]
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ func main() {
|
|||||||
func UpperCamelCase(s string) string
|
func UpperCamelCase(s string) string
|
||||||
```
|
```
|
||||||
|
|
||||||
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/todo)</span></b>
|
<b>示例:<span style="float:right;display:inline-block;">[运行](https://go.dev/play/p/65Q6iYhLRTa)</span></b>
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ func main() {
|
|||||||
func UpperCamelCase(s string) string
|
func UpperCamelCase(s string) string
|
||||||
```
|
```
|
||||||
|
|
||||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/todo)</span></b>
|
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/vPHszjTXSFp)</span></b>
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ func CamelCase(s string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UpperCamelCase coverts string to UpperCamelCase string. Non letters and numbers will be ignored.
|
// UpperCamelCase coverts string to UpperCamelCase string. Non letters and numbers will be ignored.
|
||||||
// Play: https://go.dev/play/p/todo
|
// Play: https://go.dev/play/p/vPHszjTXSFp
|
||||||
func UpperCamelCase(s string) string {
|
func UpperCamelCase(s string) string {
|
||||||
var builder strings.Builder
|
var builder strings.Builder
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user