简体   繁体   中英

There's a way to put % (sql) in java. Like this “select first_name from employees where first_name like 'A%e'”

I want to find if a string contains something like "Are" ,or "Ate", or "Aste", or "Anche" so something like string.contains("A%e"). The java way to express: select first_name from employees where first_name like 'A%e';
Thank you

Use a regular expression. For example:

"Aste".matches("A.*e")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM