stdlib: Add str::connect_ivec() temporarily

This commit is contained in:
Patrick Walton 2011-07-05 16:02:02 -07:00
parent 219cd4b21f
commit 1980a2db53

View file

@ -45,6 +45,7 @@ export unshift_byte;
export split;
export concat;
export connect;
export connect_ivec;
export to_upper;
export safe_slice;
@ -447,6 +448,16 @@ fn connect(vec[str] v, str sep) -> str {
ret s;
}
fn connect_ivec(&str[] v, str sep) -> str {
let str s = "";
let bool first = true;
for (str ss in v) {
if (first) { first = false; } else { s += sep; }
s += ss;
}
ret s;
}
// FIXME: This only handles ASCII
fn to_upper(str s) -> str {