How to delete a text in a string?
I need to delete a certain text in a string that the backend sends me (client name)
The string is one of the following:
Mr. Alan Turing (DNI: 012345678901234)
Mr. Charles Babbage (DNI: 97845565)
Mr. Stephen Wozniak (DNI: 6448775)
I need to eliminate the text that is in parathesis including the parentheses, I should only have the name of the client
To extract the name of the client I do it as follows:
const customer_name = document.querySelector("#Txt_customer_name > b")
the customer name
field is a dynamic field but it always has the same structure
First name + last name (Customer DNI)
The result I expect is:
Mr. Alan Turing