crowlogic / arb4j

arb4j is a Java API for the arbitrary precision ball arithmetic library found at http://arblib.org
Other
1 stars 0 forks source link

finish implementing replaceArrowsEllipsesAndSuperscriptAlphabeticalExponents #404

Closed crowlogic closed 5 months ago

crowlogic commented 5 months ago
  /**
   * Replaces the two character ascii arrow version -> with ➔ used to declare the
   * independent variable or declare a multivariate function "(n,x)->n*x" for
   * instance becomes "(n,x)➔n*x" and replaces ... with …
   * 
   * @param expression
   * 
   * @return expression with with the described substitions made
   */
  public static String replaceArrowsEllipsesAndSuperscriptAlphabeticalExponents(String expression)
  {
    return expression.replace("->", "➔").replace("...", "…").replace("ⁿ", "^n");
  }