Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #835

Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From markspace <-@.>
Newsgroups comp.lang.java.help
Subject Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()?
Date Wed, 06 Jul 2011 18:07:05 -0700
Organization A noiseless patient Spider
Lines 18
Message-ID <iv30ru$a8e$1@dont-email.me> (permalink)
References <521s0711i3d7bsc8620isi0oiidl91kujq@4ax.com> <iulrmk$sg9$1@dont-email.me> <k4b6175jsqa1kie5u7b7pjed29td61lkf1@4ax.com> <iuvi8e$m6g$1@dont-email.me> <7an6179km7upsvba40ebe98gmfedg2414k@4ax.com> <iuvqj8$ilj$1@dont-email.me> <dss6179oa9vq21vf7tlu6e78bdhqjdm65m@4ax.com> <iv01d2$2g5$1@dont-email.me> <vf891713vu8quck6170207ec1bv17700cf@4ax.com> <iv2b1s$27u$1@dont-email.me> <njl917lc1nft61r62721n5ihbd2mb26pam@4ax.com> <iv2o2d$lbu$1@dont-email.me> <gZqdnXOFVegZaInTnZ2dnUVZ_r2dnZ2d@earthlink.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Thu, 7 Jul 2011 01:07:10 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="5HSAJfqnDjjLFxXZ6WBWEw"; logging-data="10510"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Msd7F+hdDws3wt0evJKTbH/05MAbiYfM="
User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11
In-Reply-To <gZqdnXOFVegZaInTnZ2dnUVZ_r2dnZ2d@earthlink.com>
Cancel-Lock sha1:c2ibtuAvo98vKmkZflz9oLzhdho=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.help:835

Show key headers only | View raw


On 7/6/2011 4:53 PM, Patricia Shanahan wrote:

> Or, of course, you could use the Character.digit method. It's a bit more
> flexible, allowing a one line change e.g. to do hexadecimal instead of
> decimal, and providing easy internationalization.


This might work if paired with Character.getNumericValue(char ch), but 
the docs for getNumericValue did specifically mention digits for other 
languages that isDigit supports, so caveat emptor and be sure to test it 
carefully first.

But I was being pedagogical here: it's very important (imo) to 
understand how the definition of the ASCII and Unicode standards can 
improve program effiency drastically.  Folks here who claim to be 
experienced programmers seem to miss this idea.

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-01 12:53 -0500
  Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Jeff Higgins <jeff@invalid.invalid> - 2011-07-01 17:55 -0400
  Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? markspace <-@.> - 2011-07-01 18:19 -0700
    Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-05 10:26 -0500
      Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-05 13:39 -0400
        Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-05 13:57 -0500
          Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? markspace <-@.> - 2011-07-05 13:01 -0700
            Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-05 15:47 -0500
              Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? markspace <-@.> - 2011-07-05 14:57 -0700
                Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-06 13:11 -0500
                Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? markspace <-@.> - 2011-07-06 11:54 -0700
                Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-06 16:58 -0500
                Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? markspace <-@.> - 2011-07-06 15:36 -0700
                Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Patricia Shanahan <pats@acm.org> - 2011-07-06 16:53 -0700
                Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? markspace <-@.> - 2011-07-06 18:07 -0700
              Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-07-06 09:57 +0100
                Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-06 13:13 -0500
                Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-07-07 09:43 +0100
              Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Lothar Kimmeringer <news200709@kimmeringer.de> - 2011-07-06 11:15 +0200
                Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-06 13:14 -0500
          Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-05 16:27 -0400
            Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Lothar Kimmeringer <news200709@kimmeringer.de> - 2011-07-06 11:22 +0200
              Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-06 07:33 -0400
  Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-01 23:06 -0400
    Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Patricia Shanahan <pats@acm.org> - 2011-07-01 20:28 -0700
    Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-05 10:27 -0500
  Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? Roedy Green <see_website@mindprod.com.invalid> - 2011-07-04 08:59 -0700
    Re: Convert a String to Int: can I use toInt() instead of Integer.parseInt()? "Thee Chicago Wolf [MVP]" <.@.> - 2011-07-05 10:30 -0500

csiph-web