The Deal Journal Blog: Updated throughout. the market day with exclusive commentary, news flashes, profiles, data and more, The Deal Journal provides you. with the up-to-the-minute take on deals and deal-makers. Visit Now >>.
var numericString = testString.replace(/[^0-9]/g, ''); return numericString; }. This function uses the replace method and the /[^0-9]/g,'' Regular Expression to remove non-numeric characters from the testString variable passed in the parameter list.Save the document and launch your browser. Open the document in your browser.ips & Warnings. 1  This example runs the removeNonNumeric function when the Web page loads. 2  Remove the first three lines of code before that function to stop that from happening. 3  To use the function in production, call the function and pass it a string containing text.
There is a very nifty function you can use for this: RIGHT(). RIGHT() returns the last X characters of a certain string, based on a number of characters you specify. Like: RIGHT(text,num_chars). Say you want to remove the first 2 characters from a string in cell B1 you can use: =RIGHT(B1,LEN(B1)-2).Or in more general terms: =RIGHT(B1,LEN(B1)-[number of characters to remove]). LEN(B1) returns the length of the string in cell B1: 12 letters. 2  It then subtracts 2, in order to leave out the first 2 characters: 12-2=10. 3  Then RIGHT() takes the last 10 letters from the string and returns: marketsize. 4  In effect, this has removed the first 2 characters of the string.