Add function to expand tabs.
diff --git a/Lib/string.py b/Lib/string.py
index f7d4af6..cfb977f 100644
--- a/Lib/string.py
+++ b/Lib/string.py
@@ -143,3 +143,16 @@
 	if s[0] in ('-', '+'):
 		sign, s = s[0], s[1:]
 	return sign + '0'*(width-n) + s
+
+# Expand tabs in a string.
+# Doesn't take non-printing chars into account, but does understand \n.
+def expandtabs(s, tabsize):
+	res = line = ''
+	for c in s:
+		if c == '\t':
+			c = ' '*(tabsize - len(line)%tabsize)
+		line = line + c
+		if c == '\n':
+			res = res + line
+			line = ''
+	return res + line
diff --git a/Lib/stringold.py b/Lib/stringold.py
index f7d4af6..cfb977f 100644
--- a/Lib/stringold.py
+++ b/Lib/stringold.py
@@ -143,3 +143,16 @@
 	if s[0] in ('-', '+'):
 		sign, s = s[0], s[1:]
 	return sign + '0'*(width-n) + s
+
+# Expand tabs in a string.
+# Doesn't take non-printing chars into account, but does understand \n.
+def expandtabs(s, tabsize):
+	res = line = ''
+	for c in s:
+		if c == '\t':
+			c = ' '*(tabsize - len(line)%tabsize)
+		line = line + c
+		if c == '\n':
+			res = res + line
+			line = ''
+	return res + line