0

trying to see if the last character is a '>'......any suggestions

I already know how to check for the character


heres what I got

if (userData.getName().charAt(0)!='<' ) {


thank

4
Contributors
10
Replies
12
Views
9 Years
Discussion Span
Last Post by mimsc
0

alright...let me check that out..I'll be back to let u know

0

getting illegal start of expression and ';' expected...Im sure it's something small..or I set it up wrong....take a look

<div id="contactInfo">
  <%
	if (userData.getName().charAt(0)!='<') || (userData.getName().charAt(userData.getName().length()-1)!='>' ) {
  %>    

	<span> <%=userData.getName()%> &#8226;</span>
<%}

%>
0

Check your parenthesis on the if() statement.

ok I opened up the if:

<div id="contactInfo">
  <%
	if (userData.getName().charAt(0)!='<' || userData.getName().charAt(userData.getName().length()-1)!='>' ) {
  %>    

	<span> <%=userData.getName()%> &#8226;</span>

if I put "<sample" for the name...nuthing shows up

but if I put"sample>"..it still displays the string

0

I would think you'd want an && condition there, not an ||.

if (!userData.getName().startsWith("<") && !userData.getName().endsWith(">") )
0

This looks to me like the beginning of a html/xml parser of some kind. If I'm wrong well, there ya go.

If I'm not then perhaps you should start looking into regular expressions. As they will help you in the long run.

0

appreciate the help Ezzaral...good lookin playa!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.