stdlib: Add str::connect_ivec() temporarily
This commit is contained in:
parent
219cd4b21f
commit
1980a2db53
1 changed files with 11 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue