Mercurial > projects > mde
comparison mde/text/util.d @ 2:78eb491bd642
mergetag: partially redesigned dataset and text reader classes. Changed text format.
committer: Diggory Hardy <diggory.hardy@gmail.com>
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Sat, 03 Nov 2007 15:15:43 +0000 |
parents | 18491334a525 |
children | 9a990644948c |
comparison
equal
deleted
inserted
replaced
1:18491334a525 | 2:78eb491bd642 |
---|---|
2 * A collection of text utility functions. | 2 * A collection of text utility functions. |
3 * | 3 * |
4 ******************************************************/ | 4 ******************************************************/ |
5 module mde.text.util; | 5 module mde.text.util; |
6 | 6 |
7 T[] postTrim(T : T[]) (T[] str) { | 7 T postTrim(T) (T str) { |
8 for (uint i = str.length,j; i > 0; i = j) { | 8 uint i = str.length; |
9 for (uint j; i > 0; i = j) { | |
9 j = i - 1; | 10 j = i - 1; |
10 if (str[j] != ' ' || str[j] != '\t') break; | 11 if (str[j] != ' ' || str[j] != '\t') break; |
11 } | 12 } |
12 return str[0..i]; | 13 return str[0..i]; |
13 } | 14 } |