Question : Find a number in a string - Javascript

Hi Experts,

Using JavaScript I need to search a string to see if it has a number on the end of it. If it does I need to take the number out of the string and return the rest of the characters.

The single number is always at the end.

I'm using the jQuery library on my site if this helps.

Thank you!!

Answer : Find a number in a string - Javascript

Well if the initial volume Vo is Vd, and you want to find the time ts when V=500, then you have the equation:

   500 = Vd * e^(k*ts)

So divide both sides by Vd to get:

   500/Vd = e^(k*ts)

Take the natural log of both sides:

   ln(500/Vd) = k*ts

Divide out the k:

  1/k * ln(500/Vd) = ts

which is what you want.
Random Solutions  
 
programming4us programming4us