Skip to content

Commit f2d060e

Browse files
committed
---
yaml --- r: 3857 b: refs/heads/master c: ccd0fff h: refs/heads/master i: 3855: af06fba v: v3
1 parent 8afa299 commit f2d060e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: e038e8e52bebe33ca2d949122bf876bbb2d97936
2+
refs/heads/master: ccd0fffcce5a0f47747bc30b31f8c2c37b3ef746

trunk/src/lib/str.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,21 @@ fn split(str s, u8 sep) -> vec[str] {
442442
ret v;
443443
}
444444

445+
fn split_ivec(str s, u8 sep) -> str[] {
446+
let str[] v = ~[];
447+
let str accum = "";
448+
let bool ends_with_sep = false;
449+
for (u8 c in s) {
450+
if (c == sep) {
451+
v += ~[accum];
452+
accum = "";
453+
ends_with_sep = true;
454+
} else { accum += unsafe_from_byte(c); ends_with_sep = false; }
455+
}
456+
if (str::byte_len(accum) != 0u || ends_with_sep) { v += ~[accum]; }
457+
ret v;
458+
}
459+
445460
fn concat(vec[str] v) -> str {
446461
let str s = "";
447462
for (str ss in v) { s += ss; }

0 commit comments

Comments
 (0)