summaryrefslogtreecommitdiff
path: root/engines/kokompe/temp/string.js
blob: 42b60aa465d464a88c245a81fa42f29d0cac7703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

function triml(sString) {
	while (sString.substring(0,1) == ' ') {
		sString = sString.substring(1, sString.length);
	}
	return sString;
}

function trimr(sString) {
	while (sString.substring(sString.length-1, sString.length) == ' ') {
		sString = sString.substring(0,sString.length-1);
	}
	return sString;
}

function trim(sString) {
	sString = triml(sString);
	sString = trimr(sString);
	return sString;
}