Skip to content

Instantly share code, notes, and snippets.

View williamjeong2's full-sized avatar
👨‍🎓

Jinwoo Jeong williamjeong2

👨‍🎓
  • Alopaxalgo
  • Seoul
  • 07:29 (UTC +09:00)
View GitHub Profile
import textwrap
import re
def wrap_text_korean(text, width):
wrapped_lines = []
for line in text.splitlines():
words = re.findall(r'\S+|\s+', line)
wrapped = ''
current_width = 0
for word in words: