Raku's string split routine accepts a scalar as well as a list for its delimiter.
my Str $str = 'This string,has commas,and spaces';
my @delimiters of Str = [' ', ','];
my @array of Str = $str.split(@delimiters);
say @array.perl;
Which gives you:
Array[Str].new("This", "string", "has", "commas", "and", "spaces")
Other languages might require you to write a regular expression if you need to split a string on multiple delimiters at the same time.
Page Updates |
---|
Apache Bench load testing |
Console::Blackjack |
RetroPie Arcade |
Factorio on systemd |
Generate new Factorio map |
Recent Articles |
---|
Install xfce4 on Debian |
Console Blackjack in Perl |
Selenium::WebDriver::Error::UnknownError |
Game of Life in C++ using the SDL2 |
PigPen (dots and boxes) in C++ using the SDL2 |
Copyright © 2005 - 2021
All Rights Reserved