We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e038e8e commit ccd0fffCopy full SHA for ccd0fff
src/lib/str.rs
@@ -442,6 +442,21 @@ fn split(str s, u8 sep) -> vec[str] {
442
ret v;
443
}
444
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
+
460
fn concat(vec[str] v) -> str {
461
let str s = "";
462
for (str ss in v) { s += ss; }
0 commit comments