Check if string starts with tab

Groovy

Groovy Problem Overview


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

Groovy Solutions


Solution 1 - Groovy

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

def s = "\t"​​

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNattaView Question on Stackoverflow
Solution 1 - GroovyjjchiwView Answer on Stackoverflow