MEM MEM - 5 months ago 10x
Javascript Question

javascript grab part of a string after a . (dot)

I'm unable to read regex.

Let's say we have this string: "mydomain.bu.pu" and I want to grab the ".bu.pu" part of it;

I'm thinking about using something like:

indexOf and later substr ... But I confess I'm kind of lost...

Any help please? :D

Thanks in advance,

var afterDot = str.substr(str.indexOf('.'));