Register and join over 40,000 other developers!
Recent Topics
-
Print specific values from dictionary with a specific key name
Siten0308 - Jun 20 2019 01:43 PM
-
Learn algorithms and programming concepts
johnnylo - Apr 23 2019 07:49 AM
-
Job Gig PHP Form Needed
PJohnson - Apr 18 2019 03:55 AM
-
How to make code run differently depending on the platform it is running on?
xarzu - Apr 05 2019 09:17 AM
-
How do I set a breakpoint in an attached process in visual studio
xarzu - Apr 04 2019 11:47 AM
Recent Blog Entries
Recent Status Updates
Popular Tags
- networking
- Managed C++
- stream
- console
- database
- authentication
- Visual Basic 4 / 5 / 6
- session
- Connection
- asp.net
- import
- syntax
- hardware
- html5
- array
- mysql
- java
- php
- c++
- string
- C#
- html
- loop
- timer
- jquery
- ajax
- javascript
- programming
- android
- css
- assembly
- c
- form
- vb.net
- xml
- linked list
- login
- encryption
- pseudocode
- calculator
- sql
- python
- setup
- help
- game
- combobox
- binary
- hello world
- grid
- innerHTML

Checking if a string contains upper or lower case letters
Started by ahwoo, Sep 03 2012 09:33 PM
string
1 reply to this topic
#1
Posted 03 September 2012 - 09:33 PM
Hi,
I have to receive user input via the scanner, and then
check if the word they entered contains upper or lowercase letters,
would the method isUpperCase & isLowerCase work??
If so how would you apply it to strings.
Or would i have to use string.length and char.At??
Thanks any help is appreciated
I have to receive user input via the scanner, and then
check if the word they entered contains upper or lowercase letters,
would the method isUpperCase & isLowerCase work??
If so how would you apply it to strings.
Or would i have to use string.length and char.At??
Thanks any help is appreciated
#2
Posted 03 September 2012 - 10:23 PM
Yes you should loop over the String with the help of String.length and String.charAt(index);
Or, alternatively:
Or, alternatively:
for(char character : string.toCharArray() ){ //do stuff with character. }
Also tagged with one or more of these keywords: string
Language Forums →
C and C++ →
Why is similar string comparison giving different result?Started by nick112, 29 May 2017 ![]() |
|
![]() |
||
Language Forums →
C and C++ →
converting string to floatStarted by JonElias, 14 May 2016 ![]() |
|
![]() |
||
Language Forums →
HTML, CSS and Javascript →
How to find location of all the times a specific letter appears in stringStarted by 4ringsa6, 02 Mar 2016 ![]() |
|
![]() |
||
Language Forums →
Java →
How do I remove a character from a String?Started by dreddooo, 01 Oct 2015 ![]() |
|
![]() |
||
Language Forums →
Java →
Help needed making a String, which has all the letters in the rack (Scrabble game)Started by BobbyRedSox28, 25 May 2015 ![]() |
|
![]() |
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download