Answers for "split with different separators"

0

Split text on several separators

fn main() {
  let s = "Hey, is this a complex-program, or a complex_program";
  let chunks:Vec<_> = s.split(&[',', '-', '_'][..]).collect();

  println!("Split on multiple separators = {:?} ", chunks);
}
Posted by: Guest on May-28-2021
0

Split the string using the separator

# Split the string using the separator

text= "Orange,Apple,Grapes,WaterMelon,Kiwi"
print(text.split(','))
Posted by: Guest on December-08-2021

Code answers related to "split with different separators"

Browse Popular Code Answers by Language