extractNumber
문자열에서 숫자만 추출
하는 함수입니다.
Code
Interface
typescript
function extractNumber(value: string): string
Usage
typescript
import { extractNumber } from '@modern-kit/utils';
const str1 = extractNumber('abc123sd45'); // '12345'
const str2 = extractNumber('1 23 sd 4 5'); // '12345'
const str3 = extractNumber('🥲'); // ''
const str4 = extractNumber(' '); // ''