Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: trimming a string (with Java)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg50998] Re: trimming a string (with Java)
  • From: bghiggins at ucdavis.edu (Brian Higgins)
  • Date: Fri, 1 Oct 2004 04:48:17 -0400 (EDT)
  • References: <cj0ngc$les$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Another way to achieve your goal is to use the trim method in  Java
via J/Link:

Needs["JLink`"]

InstallJava[]

aString=JavaNew["java.lang.String","   Have a great day.  "]

aString[trim[]]

I have a web site with various examples of integrating Java with
Mathematica, including one that makes use of the Java regex package
(regular expressions) that is useful for more complicated string
manipulations (apparently regular expressions will soon be built into
Mathematica)

http://www.higgins.ucdavis.edu/Jlink.php

Cheers,

Brian


  • Prev by Date: Re: Linear Programming
  • Next by Date: Fast multiplication of polynomials mod p
  • Previous by thread: Re: Re: Linear Programming
  • Next by thread: Fast multiplication of polynomials mod p