view mde/text/util.d @ 1:18491334a525

Finished format.d and parse.d modules; moved to mde/text. Partway implementing mde.mergetag.write.TextWriter. committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Tue, 30 Oct 2007 17:08:12 +0000
parents
children 78eb491bd642
line wrap: on
line source

/*******************************************************
 * A collection of text utility functions.
 *
 ******************************************************/
module mde.text.util;

T[] postTrim(T : T[]) (T[] str) {
    for (uint i = str.length,j; i > 0; i = j) {
        j = i - 1;
        if (str[j] != ' ' || str[j] != '\t') break;
    }
    return str[0..i];
}