This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html Set by lizmat on 8 June 2022. |
|||
05:05
habere-et-disper joined
05:07
habere-et-disper left
08:08
dakkar joined
09:44
soverysour joined
10:06
soverysour left
10:37
soverysour joined,
soverysour left,
soverysour joined
12:05
soverysour left
12:06
soverysour joined,
soverysour left,
soverysour joined
|
|||
soverysour | hello, does anyone know what's the idiomatic way for removing newlines (and other whitespaces) from a raku (.WHAT) Str? Can't seem to be able to remove anything using $the-string ~~ s/\s//; | 12:19 | |
12:21
[Coke] joined
12:30
soverysour left
12:38
thundergnat joined
|
|||
thundergnat | soverysour there are a few way to do it. | 12:45 | |
m: say "does anyone know what's the idiomatic way for removing newlines (and other whitespaces)".trans(/\s/ => '') | |||
camelia | doesanyoneknowwhat'stheidiomaticwayforremovingnewlines(andotherwhitespaces) | ||
thundergnat | m: say "does anyone know what's the idiomatic way for removing newlines (and other whitespaces)".comb(/\S/).join | 12:46 | |
camelia | doesanyoneknowwhat'stheidiomaticwayforremovingnewlines(andotherwhitespaces) | ||
12:47
[Coke] left
|
|||
thundergnat | m: $_ = "does anyone know what's the idiomatic way for removing newlines (and other whitespaces)"; say S:g/\s//; | 12:48 | |
camelia | doesanyoneknowwhat'stheidiomaticwayforremovingnewlines(andotherwhitespaces) | ||
12:49
thundergnat left
|
|||
lizmat | m: say "does anyone know what's the idiomatic way for removing newlines (and other whitespaces)".subst(/\s+/,:g) | 13:07 | |
camelia | doesanyoneknowwhat'stheidiomaticwayforremovingnewlines(andotherwhitespaces) | ||
lucs | m: say S:g/\s// given "You know what I really hate?\n\tExample code that includes irrelevant-to-what-is-being shown by the example, like this one that shows one idiomatic way for removing newlines (and other whitespace) from a string." | 13:45 | |
camelia | YouknowwhatIreallyhate?Examplecodethatincludesirrelevant-to-what-is-beingshownbytheexample,likethisonethatshowsoneidiomaticwayforremovingnewlines(andotherwhitespace)fromastring. | ||
13:51
thundergnat joined
|
|||
thundergnat | m: say "You know what I really hate?\n\tExample code that includes irrelevant-to-what-is-being shown by the example, like this one that shows one idiomatic way for removing newlines (and other whitespace) from a string.".words.join; | 13:51 | |
camelia | YouknowwhatIreallyhate?Examplecodethatincludesirrelevant-to-what-is-beingshownbytheexample,likethisonethatshowsoneidiomaticwayforremovingnewlines(andotherwhitespace)fromastring. | ||
thundergnat | Like I said, a few ways to do it. Which is best will likely depend on your specific use case. | 13:52 | |
13:52
thundergnat left
14:25
human-blip left
14:26
human-blip joined
16:26
habere-et-disper joined
16:31
sjn left
16:32
sjn joined
16:36
dakkar left
16:42
habere-et-disper left
16:47
soverysour joined
|
|||
soverysour | thank you guys for all the options! :) | 17:37 | |
18:27
habere-et-disper joined
18:35
habere-et-disper left
18:57
stanrifkin joined
19:27
soverysour left
21:55
habere-et-disper joined
22:02
habere-et-disper left
|