Skip to main content
deleted 2 characters in body
Source Link
Jon Joyce
  • 213
  • 1
  • 11

This should do what you need :)

var url = "po1.btr.en.mycompany.com";
var clean = url.substr(url.indexOf('.')).replace('.','' + 1);
alert('clean'clean);

This should do what you need :)

var url = "po1.btr.en.mycompany.com";
var clean = url.substr(url.indexOf('.')).replace('.','');
alert('clean');

This should do what you need :)

var url = "po1.btr.en.mycompany.com";
var clean = url.substr(url.indexOf('.') + 1);
alert(clean);
Source Link
Jon Joyce
  • 213
  • 1
  • 11

This should do what you need :)

var url = "po1.btr.en.mycompany.com";
var clean = url.substr(url.indexOf('.')).replace('.','');
alert('clean');