summaryrefslogtreecommitdiff
path: root/hercules/code/stringutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'hercules/code/stringutils.py')
-rw-r--r--hercules/code/stringutils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/hercules/code/stringutils.py b/hercules/code/stringutils.py
index 09e3cf8..3d0b77a 100644
--- a/hercules/code/stringutils.py
+++ b/hercules/code/stringutils.py
@@ -26,3 +26,10 @@ def strToXml(data):
data = data.replace("<", "&lt;");
data = data.replace(">", "&gt;");
return data
+
+def stripNewLine(data):
+ if len(data) == 0:
+ return data
+ if data[-1] == "\n":
+ data = data[:-1]
+ return data