java - check if string ends with certain pattern

Posted by The Learner on Stack Overflow See other posts from Stack Overflow or by The Learner
Published on 2012-09-07T02:35:12Z Indexed on 2012/09/07 3:38 UTC
Read the original article Hit count: 148

Filed under:
|
|
|

I have string like:

This.is.a.great.place.too.work.

(or)

This/is/a/great/place/too/work/

than my java program should give me that the sentence is valid and it has "work".

if i Have :

This.is.a.great.place.too.work.hahahha

(or)

This/is/a/great/place/too/work/hahahah

Should not give me that there is a work in the sentance.

so I am looking at java strings to find a word at the end of the sentance having . (or),(or)/ before it. How can I achieve that

© Stack Overflow or respective owner

Related posts about java

Related posts about regex