Add methods for prefixing and suffixing

Closes #5

Align examples
This commit is contained in:
Aksel Meola 2021-05-14 13:58:34 +03:00
parent b092f52a1b
commit 10c11b1426
1 changed files with 4 additions and 4 deletions

View File

@ -337,8 +337,8 @@ LcFirst simply returns result by lower casing first letter of string and it can
Prefix makes sure string has been prefixed with a given string and avoids adding it again if it has.
```go
ufo := stringy.New("known flying object")
fmt.Println(ufo.Prefix("un")) // unknown flying object
ufo := stringy.New("known flying object")
fmt.Println(ufo.Prefix("un")) // unknown flying object
```
@ -347,8 +347,8 @@ fmt.Println(ufo.Prefix("un")) // unknown flying object
Suffix makes sure string has been suffixed with a given string and avoids adding it again if it has.
```go
pun := stringy.New("this really is a cliff")
fmt.Println(pun.Suffix("hanger")) // this really is a cliffhanger
pun := stringy.New("this really is a cliff")
fmt.Println(pun.Suffix("hanger")) // this really is a cliffhanger
```