Connecting Tech Pros Worldwide Forums | Help | Site Map

if statement with string

Newbie
 
Join Date: Feb 2008
Posts: 1
#1: Feb 28 '08
I'm fairly new to Java. I'm trying to write an if statement so if the first letter of a name is a certain letter, it's placed in a certain category. How do I specify for just the first letter? So far I have:

if(Name ==

Thanks

BigDaddyLH's Avatar
Moderator
 
Join Date: Dec 2007
Location: Kelowna, BC Canada
Posts: 1,212
#2: Feb 28 '08

re: if statement with string


Quote:

Originally Posted by griffon

I'm fairly new to Java. I'm trying to write an if statement so if the first letter of a name is a certain letter, it's placed in a certain category. How do I specify for just the first letter? So far I have:

if(Name ==

Thanks

Have you discovered the API: http://java.sun.com/javase/6/docs/api/
In it are the answers to your next 1,000 questions, but for starters, look up java.lang.String and find the method you need to answer this question.
Reply