File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: e038e8e52bebe33ca2d949122bf876bbb2d97936
2
+ refs/heads/master: ccd0fffcce5a0f47747bc30b31f8c2c37b3ef746
Original file line number Diff line number Diff line change @@ -442,6 +442,21 @@ fn split(str s, u8 sep) -> vec[str] {
442
442
ret v;
443
443
}
444
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) != 0 u || ends_with_sep) { v += ~[ accum] ; }
457
+ ret v;
458
+ }
459
+
445
460
fn concat ( vec[ str] v ) -> str {
446
461
let str s = "" ;
447
462
for ( str ss in v) { s += ss; }
You can’t perform that action at this time.
0 commit comments