I have a string lets say,
const message = 'This is a relationship: Salary = 73010 - 58.9 * Potential'
What I am trying to achieve here is get everything after relationship:
and put it in a seperate variable using Regex. After storing the new string in a seperate variable I want the old variable containing the whole string to be replaced with just
message = 'This is a relationship'
So far, I have managed to do this:
const equation = new RegExp(/relationship:.*$/); // this gets everything removed starting from the relationship:
const tooltip = message.split(equation);
const tip = message.replace(equation, '');
Apologies for my noob code. I just started understanding Regex!