Skip to content

Commit

Permalink
some more function implemented and docs files updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Waqas-Jani committed Dec 22, 2023
1 parent 03b1a63 commit aec8226
Show file tree
Hide file tree
Showing 12 changed files with 1,271 additions and 977 deletions.
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ yarn add @akcybex/jsr
After installing, you can use `@akcybex/jsr` in your Node.js application:

```javascript
import {jstr} from '@akcybex/jsr';
import JStr from '@akcybex/jsr';

const result = jstr('hello').repeat(3).upper().toString();
const result = JStr.of('hello').repeat(3).upper().toString();
console.log(result); // Outputs: 'HELLOHELLOHELLO'
```

Expand Down
17 changes: 15 additions & 2 deletions docs/After.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
### Example#1

```javascript
const str = jstr('hello world').after('w').toString();
console.log(str); // Outputs: 'orld'
import JStr from "@akcybex/jsr";

const jstr = new JStr("Hello world");
const result = jstr.after("Hello");
console.log(result); // Outputs: 'world'
```

### Example#2

```javascript
import JStr from "@akcybex/jsr";

const result = JStr.of("This is my name").after("This is");

console.log(result); // Outputs: ' my name'
```
21 changes: 21 additions & 0 deletions docs/AfterLast.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# After

### Example#1

```javascript
import JStr from "@akcybex/jsr";

const jstr = new JStr("\\App\\Http\\Controllers\\Controller");
const result = jstr.afterLast("\\");
console.log(result); // Outputs: 'Controller'
```

### Example#2

```javascript
import JStr from "@akcybex/jsr";

const result = JStr.of("abc123abc456abc789").afterLast("abc");

console.log(result); // Outputs: '789'
```
17 changes: 15 additions & 2 deletions docs/Before.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
### Example#1

```javascript
const str = jstr('hello world').before('o').toString();
console.log(str); // Outputs: 'hell'
import JStr from "@akcybex/jsr";

const jstr = new JStr("Hello world");
const result = jstr.before("world");
console.log(result); // Outputs: 'Hello'
```

### Example#2

```javascript
import JStr from "@akcybex/jsr";

const result = JStr.of("This is my name").before("my name");

console.log(result); // Outputs: 'This is '
```
20 changes: 20 additions & 0 deletions docs/BeforeLast.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Before

### Example#1

```javascript
import JStr from "@akcybex/jsr";

const jstr = new JStr("\\App\\Http\\Controllers\\Controller");
const result = jstr.beforeLast("\\");
console.log(result); // Outputs: '\\App\\Http\\Controllers'
```

### Example#2

```javascript
import JStr from "@akcybex/jsr";

const result = JStr.of("abc123abc456abc789").afterLast("abc");
console.log(result); // Outputs: 'abc123abc456'
```
23 changes: 23 additions & 0 deletions docs/Between.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Before

### Example#1

```javascript
import JStr from "@akcybex/jsr";

const jstr = new JStr("The big lion and many fox fights each other for food");
const result = jstr.between("big", "fights");
console.log(result); // Outputs: 'lion and many fox'
```

### Example#2

```javascript
import JStr from "@akcybex/jsr";

const result = JStr.of(
"The big lion and many fox fights each other for food"
).before("name", "lion");

console.log(result); // Outputs: ''
```
32 changes: 32 additions & 0 deletions docs/Contains.md
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
# Contains

### Example#1

```javascript
import JStr from "@akcybex/jsr";

const jstr = new JStr("Hello world");
const result = jstr.contains("world");
console.log(result); // Outputs: 'true'
```

### Example#2

```javascript
import JStr from "@akcybex/jsr";

const result = JStr.of("This is my name").contains("my name");

console.log(result); // Outputs: 'true'
```

### Example#3

```javascript
import JStr from "@akcybex/jsr";

const result = JStr.of(
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop"
).contains(["typesetting industry", "of"]);

console.log(result); // Outputs: 'true'
```
Loading

0 comments on commit aec8226

Please sign in to comment.