Skip to content

Commit

Permalink
docs: create removeLastCharacter (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
lumirlumir authored Nov 25, 2024
1 parent 440ab53 commit 2e5967c
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docs/src/pages/docs/api/removeLastCharacter.en.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: removeLastCharacter
---

import { Sandpack } from '@/components/Sandpack';

# removeLastCharacter

Removes the last character from a given Korean string and returns the result.

For detailed examples, see below.

```typescript
function removeLastCharacter(
// Korean string
words: string
): string;
```

## Examples

```tsx
removeLastCharacter('안녕하세요 값'); // '안녕하세요 갑'
removeLastCharacter('프론트엔드'); // '프론트엔ㄷ'
removeLastCharacter('일요일'); // '일요이'
removeLastCharacter('전화'); // '전호'
removeLastCharacter('신세계'); // '신세ㄱ'
```

## Demo

<br />

<Sandpack>

```ts index.ts
import { removeLastCharacter } from 'es-hangul';

console.log(removeLastCharacter('안녕하세요 값')); // '안녕하세요 갑'
console.log(removeLastCharacter('프론트엔드')); // '프론트엔ㄷ'
```

</Sandpack>
43 changes: 43 additions & 0 deletions docs/src/pages/docs/api/removeLastCharacter.ko.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: removeLastCharacter
---

import { Sandpack } from '@/components/Sandpack';

# removeLastCharacter

인자로 주어진 한글 문자열에서 가장 마지막 문자 하나를 제거하여 반환합니다.

자세한 예시는 아래 Example을 참고하세요.

```typescript
function removeLastCharacter(
// 한글 문자열
words: string
): string;
```

## Examples

```tsx
removeLastCharacter('안녕하세요 값'); // '안녕하세요 갑'
removeLastCharacter('프론트엔드'); // '프론트엔ㄷ'
removeLastCharacter('일요일'); // '일요이'
removeLastCharacter('전화'); // '전호'
removeLastCharacter('신세계'); // '신세ㄱ'
```

## 사용해보기

<br />

<Sandpack>

```ts index.ts
import { removeLastCharacter } from 'es-hangul';

console.log(removeLastCharacter('안녕하세요 값')); // '안녕하세요 갑'
console.log(removeLastCharacter('프론트엔드')); // '프론트엔ㄷ'
```

</Sandpack>

0 comments on commit 2e5967c

Please sign in to comment.