I have a input string like lo0.1 and lo0.2 and lo0.0.
I want to replace .0,.1 and .2 to null. So basically i want the output to be lo0 when its lo0.1 and lo0.2 and lo0.0.
I am using below code:
var reg = '\d';
if(port_key.getString().contains('.'+'reg')){
//parent_port_key.getString().setValue(port_key.getString());
parent_port_key.setValue(port_key.getString());
parent_port_key=(parent_port_key).replace('.'+'reg','');
}
Please let me know why it is not working.. What else i can do.