Here you can find the source of Sqr(String[] X)
static public String Sqr(String[] X)
//package com.java2s; //License from project: Apache License public class Main { static public String Sqr(String[] X) { String[] newstring = new String[X.length]; String pop = ""; int i;// w w w .j a v a 2 s . co m int M = 0; for (i = 0; i < X.length; i++) { if (X[i].startsWith("S")) { String XXX = X[i].substring(1, X[i].length()); double result; double a = Double.parseDouble(XXX); result = Math.sqrt(a); newstring[M] = Double.toString(result); M++; } else { newstring[M] = X[i]; M++; } } for (int ii = 0; ii < newstring.length; ii++) { if (newstring[ii] != null) pop += newstring[ii]; } return pop; } }