pike.git / lib / modules / String.pmod

version» Context lines:

pike.git/lib/modules/String.pmod:1:   #define BEGIN 32      constant count=__builtin.string_count;   constant width=__builtin.string_width;      /*    * Implode an array of strings to an english 'list' -  * ie. ({"foo","bar","gazonk"}) beomces "foo, bar and gazonk" +  * ie. ({"foo","bar","gazonk"}) becomes "foo, bar and gazonk"    */   string implode_nicely(array(string|int|float) foo, string|void and)   {    if(!and) and="and";    foo=(array(string))foo;    switch(sizeof(foo))    {    case 0: return ""; -  case 1: return foo[0]; +  case 1: return ([array(string)]foo)[0];    default: return foo[0..sizeof(foo)-2]*", "+" "+and+" "+foo[-1];    }   }      string capitalize(string s)   {    return upper_case(s[0..0])+s[1..sizeof(s)];   }      string sillycaps(string s)