How to get a URL segment I can see that craft.request.firstSegment and craft.request.lastSegment works but craft.request.secondSegment does not. Is there a way (as in ExpressionEngine) to get the value of any URL segment?
Craft 2: craft.request.getSegment(2), see Craft docs

Craft 3: craft.app.request.getSegment(2)