Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Trim a space from a string

Posted on 2002-03-21
2
Medium Priority
?
196 Views
Last Modified: 2010-04-01
I'm looking for the best way to trim a spaces from a variable.  Like Trim()!
0
Comment
Question by:khagen
  • 2
2 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 6886125
String str = "  hi  there   ";
String str2 = str.trim();
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 80 total points
ID: 6886129
or,

<%=str.trim()%>
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Transferring FSMO roles is done when an admin wants to split roles between certain Domain Controllers or the Domain Controller holding the Roles has been forcefully demoted using dcpromo / forceremoval
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question