JSFiddle - React, Tailwind, and code Playground
JavaScript
var str = 'cargo diretor (a)';
var regex = /\((.*?)\)/;
if (str.match(regex)) {
str = str.replace(regex, '');
}
alert(str);
var str = 'cargo diretor (a)';
var regex = /\((.*?)\)/;
if (str.match(regex)) {
str = str.replace(regex, '');
}
alert(str);