Program Tip

문자열이 같지 않은 경우 어떻게 비교합니까?

programtip 2020. 11. 14. 10:58
반응형

문자열이 같지 않은 경우 어떻게 비교합니까?


문자열이 다음과 같지 않은 경우에만 무언가를 표시하려고합니다.

<c:if test="${content.getContentType().getName() != "MCE"}">
<li><a href="#publish-history" id="publishHistoryTab">Publish History</a></li>
</c:if>

자꾸 오류를 던진다 org.apache.jasper.JasperException: /WEB-INF/jsp/content/manage.jsp(14,60) PWC6212: equal symbol expected

나는 또한 not eq대신 시도 했다!=

유효한 구문은 not equal to무엇입니까?


하나 !=또는 ne작동합니다 ,하지만 당신은 얻을 필요가 접근 구문을 중첩 따옴표를 정리.

<c:if test="${content.contentType.name ne 'MCE'}">
    <%-- snip --%>
</c:if>

참고 URL : https://stackoverflow.com/questions/12144466/how-do-i-compare-if-a-string-is-not-equal-to

반응형