Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
// version 1.0.6
|
||||
|
||||
val r = Regex("""(/\*.*\*/|//.*$)""")
|
||||
|
||||
fun stripComments(s: String) = s.replace(r, "").trim()
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val strings = arrayOf(
|
||||
"apples, pears // and bananas",
|
||||
" apples, pears /* and bananas */",
|
||||
"/* oranges */ apples // pears and bananas ",
|
||||
" \toranges /*apples/*, pears*/*/and bananas"
|
||||
)
|
||||
for (string in strings) println(stripComments(string))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue