\u00A0 in VB.NET

J

Jeff

Hi -

I'm using VB.NET to build an ASP.NET page with a dropdownlist control. I'm
trying to insert spaces into dropdownlist listitem text values. I read that
it's possible to do so with "\u00A0" to represent a non-breaking space
character. How do you implement such a character in VB.NET?? Or is ther a
different/better approach?

Thanks for your help.

- Jeff
 
K

Karl Seguin

You should be able to do it via:


dim spaces as string = DecodedSpaces(2)
lBoxLocation.Items.Add(spaces + dirInfo.Name,dirInfo(i).FullName)


public shared function DecodedSpaces(numberOfSpaces as integer) as string
dim spaces as string = ""
for i as integer = 0 to numberofSpaces - 1
spaces &= " "
next
return HttpUtility.HtmlDecode(spaces)
end function

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 
J

Jeff

Thanks, Karl -

That seems to work.

- Jeff


Karl Seguin said:
You should be able to do it via:


dim spaces as string = DecodedSpaces(2)
lBoxLocation.Items.Add(spaces + dirInfo.Name,dirInfo(i).FullName)


public shared function DecodedSpaces(numberOfSpaces as integer) as string
dim spaces as string = ""
for i as integer = 0 to numberofSpaces - 1
spaces &= " "
next
return HttpUtility.HtmlDecode(spaces)
end function

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)

Jeff said:
Hi -

I'm using VB.NET to build an ASP.NET page with a dropdownlist control. I'm
trying to insert spaces into dropdownlist listitem text values. I read that
it's possible to do so with "\u00A0" to represent a non-breaking space
character. How do you implement such a character in VB.NET?? Or is
ther
a
different/better approach?

Thanks for your help.

- Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top