wiki:Mjonot
Last modified 9 years ago Last modified on 2008-10-16 14:54:35

Mjonot

Mjonot (merkkijonot = strings) is a class with a set of methods for dealing with strings.

Mjonot.erotaDouble

The method erotaDouble will separate (erota = separate) the next real number from the beginning of the string given as first parameter. If no real number was found the method will return the default value given as second parameter.

Here is an example:

String line = " k34.5r";
double num = Mjonot.erotaDouble(line,0);
System.out.println(num); // This will print: 34.5

The variable num will have the value of 34.5.
(If no real number was found the value of num would be 0.)

Note

Don't forget to import Mjonot from Ali.jar:

import fi.jyu.mit.ohj2.Mjonot;