Scripts: JSP :: string functions :: Library Article #1

Developer's Section

Using string buffer in JSP
By: Erobo Team Member

Hire a Developer for Related Work / Installation | $55 hr
Average Votes: (2485)
Rate It:   

Learn how to use a string buffer in JSP

The best way to concatenate strings in JSP is by using a String Buffer object. In JSP you can declare and use a String Buffer the following way:

 Code Snippet 1

<%@ page import = "*, java.util.*" %>
//Create a new string buffer
//Note empty parameter
StringBuffer thisBuffer = new StringBuffer("");

//Append a few characters
thisBuffer.append(" like");
thisBuffer.append(" to");
thisBuffer.append(" eat");
thisBuffer.append(" chocolate");

//print result of concatenation
//output should be: I like to eat chocolate

See other Scripts in string functions


Submit Your Scripts:

If you would like to have your JSP scripts published in this section please fill out
the form below:
*Your Name or
Home Town:
*Description and Code:
*Enter Code shown
to the right:

[ Refresh Image ]


© 2018 Erobo Software, Inc. All Rights Reserved. | Read Privacy Notice | RSS