Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String contains method in jsf

Tags:

jsf

el

jsf-2

i was wondering how to use/implement string contains method in jsf2 without using JSTL. please advise, thanks.

like image 603
Mahmoud Saleh Avatar asked Dec 03 '12 10:12

Mahmoud Saleh


People also ask

Does string have Contains method?

contains() method searches the sequence of characters in the given string. It returns true if sequence of char values are found in this string otherwise returns false.

How do I check if a string contains?

The includes() method returns true if a string contains a specified string. Otherwise it returns false . The includes() method is case sensitive.

What is string contains () in Java?

Java String contains() Method The contains() method checks whether a string contains a sequence of characters. Returns true if the characters exist and false if not.

Is there a Contains method in Java?

The contains() method in Java is used to search the substring in a given String. Returns: If the substring is found in the specified String, then it returns a true value; otherwise, it returns​ a false value.


1 Answers

<h:outputText value="#{'I love JSF'.contains('JSF')}" /> <!-- true -->

OR

<h:outputText value="#{myBean.text.contains('some_word')}" />
like image 157
prageeth Avatar answered Oct 16 '22 15:10

prageeth