52

How do I check if a string starts with a tab in Groovy?

1

1 Answer 1

105

This are some ways to do it....there are more like regex

​def s = "\t"​​

assert s[0] == "\t"
assert s.startsWith("\t")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.