@@ -9,6 +9,7 @@ A lightweight and versatile String Utility Package for Node.js & Browser.
99<img src =" https://user-images.githubusercontent.com/6517308/121813242-859a9700-cc6b-11eb-99c0-49e5bb63005b.jpg " >
1010
1111# Contents
12+
1213* [ Install] ( #install )
1314* [ require] ( #require )
1415* [ import] ( #import )
@@ -37,14 +38,11 @@ A lightweight and versatile String Utility Package for Node.js & Browser.
3738 * [ isAlpha] ( #isalpha )
3839 * [ isAlphaNumeric] ( #isalphanumeric )
3940 * [ reverse] ( #reverse )
40-
41- (Coming Soon)
42- * [ StringBuilder] ( # )
43- * [ StringValidator] ( # )
4441 * [ Build] ( #build )
4542 * [ License] ( #license )
4643
47- ## install
44+ ## Install
45+
4846``` sh
4947npm install @full-pack/string-pack
5048```
@@ -61,13 +59,16 @@ const { ... } = require('@full-pack/string-pack');
6159import { ... } from ' @full-pack/string-pack' ;
6260```
6361
64- ## API
62+ ## APIs
63+
64+ ### Padding
6565
66- ### padding
6766Adds padding to given string.
6867
6968##### padStart
69+
7070Pads the start of a string with a specified fill string a certain number of times.
71+
7172``` js
7273// Basic Usage
7374padStart (' hello' , ' abc' , 3 ) // abcabcabchello
@@ -77,7 +78,9 @@ padStart('hello', 'abc', 3, 8) // abchello
7778```
7879
7980##### padEnd
81+
8082Pads the end of a string with a specified fill string a certain number of times.
83+
8184``` js
8285// Basic Usage
8386padEnd (' hello' , ' abc' , 3 ); // helloabcabcabc
@@ -87,7 +90,9 @@ padEnd('hello', 'abc', 3, 8); // helloabc
8790```
8891
8992##### padBidirectional
93+
9094Pads a string with a specified fill string a certain number of times on both ends.
95+
9196``` js
9297// Basic usage
9398padBidirectional (' hello' , ' *' , {repeatCount: 2 }); // '**hello**'
@@ -101,7 +106,9 @@ padBidirectional('example', '*', {repeatCount: 2, maxLen: 10, bias: PaddingBias.
101106```
102107
103108### merge
109+
104110Merges an array of strings into a single string using a specified separator.
111+
105112``` js
106113merge (' -' , ' apple' , ' orange' , ' banana' ); // 'apple-orange-banana'
107114
@@ -111,31 +118,39 @@ merge(false, 'apple', 'orange', 'banana'); // 'appleorangebanana'
111118```
112119
113120### compare
121+
114122Performs a strict comparison between two strings.
123+
115124``` js
116125compare (" hello" , " hello" ); // true
117126
118127compare (" abc" , " ABC" ); // false
119128```
120129
121130### looseCompare
131+
122132Performs a case-insensitive loose comparison between two strings.
133+
123134``` js
124135looseCompare (" hello" , " HELLO" ); // true
125136
126137looseCompare (' abc' , ' 123' ); // false
127138```
128139
129140### capitalizeInitial
141+
130142Capitalizes the first letter of a word in a string.
143+
131144``` js
132145capitalizeInitial (' hello' ); // 'Hello'
133146
134147capitalizeInitial (' :> hello' ); // ':> Hello'
135148```
136149
137150### capitalizeWords
151+
138152Capitalizes the first letter of each word in a given string.
153+
139154``` js
140155capitalizeWords (' hello world' ); // 'Hello World'
141156
@@ -145,31 +160,39 @@ capitalizeWords('Sphinx of black quartz:-judge my vow'); // 'Sphinx Of Black Qua
145160### Case Conversion
146161
147162#### snakeCase
163+
148164Converts a string to snake_case format.
165+
149166``` js
150167snakeCase (' hello WorLd' ); // 'hello_world'
151168snakeCase (' from-kebab-case' ); // 'from_kebab_case'
152169snakeCase (' snake Case With Numbers123' , true ); // 'snake_case_with_numbers_one_two_three'
153170```
154171
155172#### kebabCase
173+
156174Converts a string to kebab-case format.
175+
157176``` js
158177kebabCase (' h3llo WoRld' ); // 'h3llo-world'
159178kebabCase (' from_snake_case' ); // 'from-snake-case'
160179kebabCase (' kebab Case With Numbers123' , true ); // 'kebab-case-with-numbers-one-two-three'
161180```
162181
163182#### camelCase
183+
164184Converts a string to camelCase format.
185+
165186``` js
166187camelCase (' hello WoRld' ); // 'helloWorld'
167188camelCase (' Test CaSe ExamplE' ); // 'testCaseExample'
168189camelCase (' camel Case With Numbers123' ); // 'camelCaseWithNumbers'
169190```
170191
171192#### pascalCase
193+
172194Converts a string to PascalCase format.
195+
173196``` js
174197pascalCase (' hello WoRld' ); // 'HelloWorld'
175198pascalCase (' Test CaSe ExamplE' ); // 'TestCaseExample'
@@ -179,7 +202,9 @@ pascalCase('pasCal Case With Numbers123'); // 'PascalCaseWithNumbers'
179202### Case Validation
180203
181204#### isSnakeCase
205+
182206Checks if a string is in snake_case format.
207+
183208``` js
184209// Valid
185210isSnakeCase (' snake_case_example' ); // true
@@ -196,7 +221,9 @@ isSnakeCase('no_CAPS'); // false
196221```
197222
198223#### isKebabCase
224+
199225Checks if a string is in kebab-case format.
226+
200227``` js
201228// Valid
202229isKebabCase (' kebab-case-example' ); // true
@@ -213,7 +240,9 @@ isKebabCase('no-CAPS'); // false
213240```
214241
215242#### isCamelCase
243+
216244Checks if a string is in camelCase format.
245+
217246``` js
218247// Valid
219248isCamelCase (' camelCaseExample' ); // true
@@ -226,7 +255,9 @@ isCamelCase('withThe1234'); // false
226255```
227256
228257#### isPascalCase
258+
229259Checks if a string is in PascalCase format.
260+
230261``` js
231262// Valid
232263isPascalCase (' PascalCaseExample' ); // true
@@ -239,7 +270,9 @@ isPascalCase('WithThe1234'); // false
239270```
240271
241272### regionMatch
273+
242274Compares two strings or regions for equality.
275+
243276``` js
244277// Matching identical strings
245278regionMatch (' hello' , ' hello' ); // true
@@ -256,7 +289,9 @@ regionMatch('hello world', 'hello there', 6, 11); // false
256289```
257290
258291### looseRegionMatch
292+
259293Performs a loose comparison of two strings or regions for equality.
294+
260295``` js
261296// Loose matching identical strings
262297looseRegionMatch (' hello' , ' HeLLo' ); // true
@@ -268,29 +303,39 @@ looseRegionMatch(str1, str2); // true
268303```
269304
270305### isAlpha
306+
271307Checks if a string contains only alphabetic characters (A-Z, a-z).
308+
272309``` js
273310isAlpha (" HelloWorld" ); // true
274311isAlpha (" Hello123" ); // false
275312```
276313
277314### isAlphaNumeric
315+
278316Checks if a string contains only alphanumeric characters (A-Z, a-z, 0-9).
317+
279318``` js
280319isAlphaNumeric (" Hello01" ); // true
281320isAlphaNumeric (" 1234567890" ); // false
282321```
283322
284323### Reverse
324+
285325Reverses the sequence of characters in given string.
326+
286327``` js
287328reverse (' bad' ) // 'dab'
288329```
289330
331+ Full documentation [ here] ( https://full-pack.github.io/string-pack )
332+
290333## Build
334+
291335```
292336npm run build
293337```
294338
295339## License
340+
296341The MIT License. Full License is [ here] ( LICENSE )
0 commit comments