I have a string which looks like this - sometext;;sometext;;sometext;;sometext
i'd like to have it displaying on a page looking like this
sometext
sometext
sometext
sometext
i know i need a loop and a split, but i'm not sure how to get it working, any help would be great, thanks
13 1748
Not necessarily. If we assume for the moment that your string is in a variable called YourString and there's a multiline textbox called Text1 on the form, try this... - Text1.Text = Replace(YourString, ";;", vbNewLine)
I have a string which looks like this - sometext;;sometext;;sometext;;sometext
i'd like to have it displaying on a page looking like this
sometext
sometext
sometext
sometext
i know i need a loop and a split, but i'm not sure how to get it working, any help would be great, thanks
Where did you store your String"sometext;;sometext;;sometext;;sometext"?
lets say that your "sometext;;sometext;;sometext;;sometext" is the object Text1.
then we can do coding as:
Text1.Text = Replace(Text1.Text, ";;", vbNewLine)
Note:
During Design time set Multiline to TRUE.
Regards
ideally i'd like to have it display in either a label or via response.write
the solutions that have been posted make the string sometext;;sometext;;sometext etc.. display as
sometext sometext sometext - but with no new line breaks, how would i get it to display as
sometext
sometext
sometext etc.
current code
> lblmach.Text = Replace(stringmach, ";;", vbNewLine)
Hi,
Make Labels's property WordWrap = True and display..
Label1.Caption = Replace(MyString,";;",vbCrLf)
REgards
Veena
i'm using vs2005, a label control doesnt seem to have wordwrap.
If you are using Textbox to display results then, the only thing you need to do is set Multiline property then try this code
Text1.Text = Replace(YourString, ";;", vbNewLine)
If you are using label then this code will work as it is.
regards
farhana
output from a label
sometext sometext sometext
i'm using vs2005, a label control doesnt seem to have wordwrap.
Hi,
for VB.net 2005, Label Control will display MultiLine by default, u dont have to set any properties...
REgards
Veena
yes you are right, however the replace line is only removing the commas from the delimited string, it is not adding a new line in between each word. therefore the text will display not as a multiline, but as one string
the string is similar to this some text;;text;;more text;;even more text;; !
yes you are right, however the replace line is only removing the commas from the delimited string, it is not adding a new line in between each word. therefore the text will display not as a multiline, but as one string
Hi,
New Line will be added, only if it finds ";;" ...
If it encounters only one semicolon, new line will not be added.
You need to check the String again..
Regards
Veena
before replace line -
Leaflets;;Brochures to 50,000+ colour;;All stationary, including letterheads, business compliment slips;;NCR carbonless options
after replace line -
Leaflets Brochures to 50,000+ colour All stationary, including letterheads, business compliment slips NCR carbonless options
Hi,
You must be using ASP.net, my code was for VB.net.
I don't know why NewLine does not work, anyway here is the workaround:
say your string variable is MyString -
Dim TArr
-
Dim i As Integer
-
TArr = MyString.Split(";;")
-
For i = 0 To UBound(TArr)
-
Response.Write(TArr(i) & "<br>")
-
Next
-
Regards
Veena
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jeremy Owens-Boggs |
last post by:
We are trying to implement a dual list box selection where you have two list
boxes, You highlight items in the right side list box, click a button and
this moves those items over to the left hand...
|
by: Guadala Harry |
last post by:
I want to create a STATIC method that removes all items from the Cache.
Questions:
1. Is a safe thing to do (any threading issues?)
2. Is the following code a good way to get the job done -...
|
by: Chris |
last post by:
I find tons of info on adding, but what about removing an item dynamically?
I'm cycling through the list and removing users that have special rights.
I've tried things like:
...
|
by: Ash Phillips |
last post by:
Hi Everyone,
I have this program I wrote in VB6 for family use. It's a DVD Database just
for me to keep track of them cause I have so many lol.
In VB6, I could add items to the ListView in...
|
by: Peter Row |
last post by:
Hi,
I am currently working on a VB.NET project that has been going for quite a
while.
In the past it has been developed with a lot of compatibility VB6 functions
and
constants, e.g Left(),...
|
by: Eric_Dexter |
last post by:
def simplecsdtoorc(filename):
file = open(filename,"r")
alllines = file.read_until("</CsInstruments>")
pattern1 = re.compile("</")
orcfilename = filename + "orc"
for line in alllines:
if not...
|
by: =?Utf-8?B?Sm9lbCBNZXJr?= |
last post by:
I have created a custom class with both value type members and reference type
members. I then have another custom class which inherits from a generic list
of my first class. This custom listneeds...
|
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= |
last post by:
Hello,
In my application I need to periodically remove all current items from a
ListView and add a new set into it. The following abbreviated code contains
the basic idea:
private void...
|
by: Adam Salisbury |
last post by:
**To members of microsoft.public.dotnet.framework, apologies for the
crosspost. I originally posted this message into that group however
have since realised this may have been a better...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |