javascript split get last element
a = "hello.dear.friends"
a.split(".").pop()
> "friends"Use rev command altogether with cut command as follows:
echo "a1 a2 a3 a4 a5" | rev | cut -d ' ' -f '1' | rev
#rev reverses string, then you cut from 2th field to end and reverse back
Also in JavaScript:
- javascript get array difference
- Javascript compare two dates
- how to make use of nodejs single thread to read files and attach data
- javascript add items to array
- capitalize first letter of each word javascript
- serverless and connections mongodb atlas
- hide url in discord.js
- vue js get routes
- document.queryselector picks first or last
- get all keys in json object
- learn json
- axios post with header
- NullInjectorError: R3InjectorError HttpClient
- ngx-translate angular 11
- How to call the ajax when form is valid
- react return action in a function
- react admin
- print to console without newline nodejs
- react onclick parameter
- route parammap subscribe angular 9
- bootstrap 5 with angular modal
- jstree select all visible node only
- node_modules/metro/src/lib/attachWebsocketServer.js
- javascript typewriter effect