I Have string random length
Ex:
sadsadsadsad(323213)dfsssds sadsadsadsad(321)dfsssds
How can I find the values in brackets?.
You can use indexOf and substring
indexOf
substring
let str = 'sadsadsadsad(321)dfsssds'; let getFirstIndex = str.indexOf('('); let getSecondIndex = str.indexOf(')'); let subStr = str.substring(getFirstIndex + 1, getSecondIndex); console.log(subStr)