I am trying to write javascript code that would trim the last section of an ip address (string), such as 123.456.789.012
, and return the trimmed ip string, which in the case of the example would be 123.456.789
How would this be done (regex?)?
Please excuse my lack of proper terminology. I hope this makes enough sense.
Thanks