I'm working on a square root function in Java and I need it to take the number beginning on character 5, ending on the second last one. It currently displays "sqrt([NUMBER])". I've tried to use substring but it doesn't work. I've put my code below.
a = Math.sqrt( Double.parseDouble(t.getText().substring( 4, t.getText().length() - 1)));
String s = "sqrt(1.234)";