LowerFirst converts the first rune of str to lowercase.
(str T)
| 43 | |
| 44 | // LowerFirst converts the first rune of str to lowercase. |
| 45 | func LowerFirst[T ~string](str T) T { |
| 46 | runes := []rune(str) |
| 47 | switch len(runes) { |
| 48 | case 0: |
| 49 | return "" |
| 50 | case 1: |
| 51 | return T(unicode.ToLower(runes[0])) |
| 52 | default: |
| 53 | runes[0] = unicode.ToLower(runes[0]) |
| 54 | return T(runes) |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | // Without numbers returns the string with all numeric runes removed. |
| 59 | // |
searching dependent graphs…