Skip to content

Commit 7bcc0df

Browse files
committed
Updated documentation to version 0.3.0
1 parent d6dbe78 commit 7bcc0df

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Gradle users can add following to their build.gradle file.
2626
compile(group: 'com.shekhargulati', name: 'strman', version: '0.3.0')
2727
```
2828

29+
To learn what we added in the latest version please refer to `./changelog.md`.
30+
2931
## Available Functions
3032

3133
These are the available functions in current version of library:
@@ -80,6 +82,16 @@ chars("title")
8082
// result => ["t", "i", "t", "l", "e"]
8183
```
8284

85+
## charsCount
86+
87+
Counts the number of occurrences of each character in the string
88+
89+
```java
90+
import static strman.Strman.charsCount
91+
charsCount("abca")
92+
// result => Map(("a",2),("b",1),("c",1))
93+
```
94+
8395
## collapseWhitespace
8496

8597
Replace consecutive whitespace characters with a single space.
@@ -496,6 +508,17 @@ transliterate("fóõ bár")
496508
// result => "foo bar"
497509
```
498510

511+
## trimEnd
512+
513+
Removes trailing characters from string.
514+
515+
```
516+
trimEnd(" abc ")
517+
// result => Optional(" abc")
518+
trimEnd("")
519+
// result Optional.empty()
520+
```
521+
499522
## surround
500523

501524
Surrounds a 'value' with the given 'prefix' and 'suffix'.
@@ -559,6 +582,42 @@ toSnakeCase("hello world")
559582
// result => "hello_world"
560583
```
561584

585+
## upperFirst
586+
587+
Converts the first character of string to upper case.
588+
589+
```java
590+
upperFirst("fred")
591+
// result => "Fred"
592+
```
593+
594+
## words
595+
596+
Splits a String to words
597+
598+
```java
599+
words("This is a string, with words!")
600+
// result => ["This", "is", "a", "string", "with", "words"]
601+
```
602+
603+
## isEnclosedBetween
604+
605+
Verifies whether String is enclosed by encloser
606+
607+
```java
608+
isEnclosedBetween("{{shekhar}}", "{{", "}}")
609+
// result => true
610+
```
611+
612+
## join
613+
614+
Join concatenates all the elements of the strings array into a single String. The separator string is placed between elements in the resulting string.
615+
616+
```java
617+
join(new String[]{"hello","world","123"}, ";")
618+
// result => "hello;world;123")
619+
```
620+
562621
License
563622
-------
564623
strman is licensed under the MIT License - see the `LICENSE` file for details.

0 commit comments

Comments
 (0)