Regular Expression - Javascript

Separate string by character length

"This is String".replace(/(.{4})/,"$1\n")
Result:
This
 is 
Stri
ng

Tidak ada komentar:

Posting Komentar