Solved

Trim a space from a string

Posted on 2002-03-21
2
192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 20 total points
ID: 6886129
or,

<%=str.trim()%>
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
java cyclic graphs 15 223
console vs log file 16 85
Java Exception example issues 11 84
spring example non maven 4 105
Configuring Remote Assistance for use with SCCM
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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