aspose file tools*
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
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