Javascript how to verify if string contain ' \ ' with includes()

I’m trying to to verify if a string contain this simbol \.

if (this.inputCity.includes('\')){
    // do something,,,
}

The problem is that backslash? is an escape? character…
So how can I check if string contain \ ?

Thanks!

34 thoughts on “Javascript how to verify if string contain ' \ ' with includes()”

Leave a Comment