Question

How to split a string by a special character in gradle

ie.

String strDomain = "domain\my name"

and catch

"domain","my name"
Was it helpful?

Solution

Use regular Java/Groovy:

def strDomain = "domain\\my name"
println strDomain.split("\\\\")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top