pike.git / lib / modules / String.pmod

version» Context lines:

pike.git/lib/modules/String.pmod:164:    {    fuzz = 100;    } else {    fuzz = low_fuzzymatch(a, b);    fuzz += low_fuzzymatch(b, a);    fuzz = fuzz*100/(strlen(a)+strlen(b));    }       return fuzz;   } +  + string trim_whites( string what ) + { +  if (stringp (what)) { +  sscanf(what, "%*[ \t]%s", what); +  string rev = reverse(what); +  sscanf(rev, "%*[ \t]%s", rev); +  return what[..strlen(rev) - 1]; +  } +  +  return what; + } +  + string trim_all_whites( string what ) + { +  if (stringp (what)) { +  sscanf(what, "%*[ \t\r\n]%s", what); +  string rev = reverse(what); +  sscanf(rev, "%*[ \t\r\n]%s", rev); +  return what[..strlen(rev) - 1]; +  } +  +  return what; + }