[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1644
  • Last Modified:

How to remove white space from a string

Greetings,

I am using query string to pass the variable as the following.

<td><a href='details.aspx?po=<%#DataBinder.Eval(Container.DataItem, "af1")%>&facct=<%#DataBinder.Eval(Container.DataItem, "funding_code")%>'>

But I got "<td><a href='details.aspx?po=D633963                       &facct=2-89064" from the string. it seems there are white space in <%#DataBinder.Eval(Container.DataItem, "af1")%>

How to remove those white spaces?

Thanks.
0
mrong
Asked:
mrong
  • 3
  • 2
1 Solution
 
bruintjeCommented:
Hi mrong,

you can use a trim around the value

Trim(DataBinder.Eval(Container.DataItem, "af1"))

hope this helps a bit
bruintje
0
 
mrongAuthor Commented:
What should I do in my case?

Thanks.
0
 
bruintjeCommented:
are you using C#?
0
 
mrongAuthor Commented:
asp.net
0
 
bruintjeCommented:
yes i saw that, was only wondering what language you're using for inline coding

can't you do something like

<td><a href='details.aspx?po=<%#Trim(DataBinder.Eval(Container.DataItem, af1"))%>&facct=<%#Trim(DataBinder.Eval(Container.DataItem, "funding_code"))%>'>
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now