I've written a simple method for stripping whitespace from the begining and end of strings
(same thing as python's strip() or java's trim()).
It has come in pretty useful for application level string handling. Would it be possible to
add it to the code base?
Also, is there any plan to modulerize the builtins? (e.g.@load builtins.string), as the project
grows, bro.bif is going to get (further) out of control.
thanks
.martin
function strip%(str: string%): string
    %{
        const char* s = str->CheckString();
        int n = strlen(s) + 1;
        char* strip_s = new char[n];
        while(isspace(*s))
        { s++; }
        strncpy(strip_s, s, n);
        s = strip_s;
        char* e = (char*)(s + (strlen(s) - 1));
        while(isspace(*e))
        { e--; }
        *(e+1) = 0;
        return new StringVal(new BroString(1, byte_vec(s), (e-s)+1));
    %}