RosettaCodeData/Task/Strip-comments-from-a-string/Groovy/strip-comments-from-a-string-1.groovy

2 lines
56 B
Groovy
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
def stripComments = { it.replaceAll(/\s*[#;].*$/, '') }