wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes How to search a specific character in a String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to search a specific character in a String" Watch "How to search a specific character in a String" New topic
Author

How to search a specific character in a String

Anagha Medicharla
Greenhorn

Joined: Feb 06, 2001
Posts: 11
Hi,
Using swing i am creating a text field which will take email address from user.I have one question ,how to check that user has entered '@'(and also '.').Does anybody know this?
I need urgent help.

Thanks
Anagha
------------------
deekasha gunwant
Ranch Hand

Joined: May 06, 2000
Posts: 396
Hi Anagha,
u can use
int i = txtfld.getText().indexOf('@');
if i==-1 then it means '@' is not there in the textfield.

regards
deeksha
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to search a specific character in a String
 
Similar Threads
JUnit and Cactus using strutstestCase
SCJP Logo
Assert stmt in Eclipse
Dynamic Data Types in Eclipse
Accessing servlet-config parameter through EL