Re: String/isUpperCase?

From: Roedy Green (roedy_at_seewebsite.com)
Date: 10/31/03


Date: Fri, 31 Oct 2003 19:15:17 GMT

On Fri, 31 Oct 2003 11:22:26 -0500, "jim" <jblduron@bright.net> wrote
or quoted :

>I'm new to java and could use some help with a program that reads a string
>and counts the Upper Case letters. I tried isUpperCase but it was only doing
>a character not the whole string. Do I need some sort of next command or can
>I change the string to something else? any help would be appreciated.

you could either loop checking each char or more crudely you could use
toUpperCase and compare using equals with the original. It would
probably even work using ==, but that would be living dangerously.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming. 
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


Relevant Pages

  • Re: Portable and ok?
    ... you can easily construct constant expressions ... Character and string literals are a bit more difficult. ... You can do the same thing for letters by checking ...
    (comp.lang.c)
  • Re: [Full-Disclosure] TinyURL
    ... Tinyurl will store that long link, ... > It appears that the last four letters are incremented one letter at a ... > one character in the url and came across a link to a kiddie porn site... ... > that types in the string. ...
    (Full-Disclosure)
  • RE: [Full-Disclosure] TinyURL
    ... Tinyurl will store that long link, ... > It appears that the last four letters are incremented one letter at a ... > one character in the url and came across a link to a kiddie porn site... ... > that types in the string. ...
    (Full-Disclosure)
  • Re: coding an anagram function
    ... Any reason you cannot use the ASCII values of each character? ... contents are anagrams of each other. ... The cells will only contain letters, and no letter will appear more ... For this to produce a unique result for any given string, ...
    (microsoft.public.excel.programming)
  • Re: Help a beginner - simple lowercase to uppercase and so on function
    ... can understand everything but it should take shape with more practice ... it compiles and returns uppercase letters ... in this string!" ... to compile on both. ...
    (comp.lang.c)