%@ page import="java.util.*" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/ea/core" %>
The EcmaScript String object type has methods for operating on string values. Many of these methods simply make a copy of the string with HTML tags added before and after. Other methods can extract a character or substring or serach for a character in a substring. Here are examples of a few of these methods
Here are some examples:
<% request.setAttribute("fullString", new String("Harrison Ford")); %> <% request.setAttribute("numString", new String("7/13/1942: Happy Birthday")); %> <% request.setAttribute("harrison", new String("Harrison")); %> <% request.setAttribute("ford", new String("Ford")); %> <% request.setAttribute("rocks", new String(" Rocks")); %> <% request.setAttribute("a", new String("a")); %> <% request.setAttribute("two", new String("2")); %> <% request.setAttribute("five", new String("5")); %> <% request.setAttribute("myColor", new String("00FF00")); %> <% request.setAttribute("mySize", new Integer("5")); %>String Value | Operation | Result |
---|---|---|
String.anchor() |
||
String.big() |
||
String.bold() |
||
String.charAt( |
||
String.concat( |
||
String.fontcolor( |
||
String.fontSize( |
||
String.indexOf( |
||
String.italics() |
||
String.length |
||
String.link( |
||
String.slice( |
||
String.small() |
||
String.strike() |
||
String.sub() |
||
String.substring( |
||
String.toLowerCase() |
||
String.toUpperCase() |
||
parseInt( |
||
escape( |
||
unescape( |