I'm trying to parse a sentence and want to remove selected words from the
middle.
Consider:
dim a() as object = split(mySentence)
for each w in a()
select case w
case w.startswith("X")
'code to remove this specific word from the array
end select
next
result = join(a)
Can't find a way to remove the word. Any help out there?
I'm now looking at arrayList, which might have the methods I need, but
haven't figured out how to do the split trick.
Jeremy 3 2106
I would first use replace to get rid of any double spaces then use split to
split the sentence up into an array of words based as a space as the
delimiter.
"Jeremy" wrote: I'm trying to parse a sentence and want to remove selected words from the middle.
Consider:
dim a() as object = split(mySentence)
for each w in a() select case w case w.startswith("X") 'code to remove this specific word from the array end select next
result = join(a)
Can't find a way to remove the word. Any help out there?
I'm now looking at arrayList, which might have the methods I need, but haven't figured out how to do the split trick.
Jeremy
"Jeremy" <je****@ninprodata.com> schrieb: I'm trying to parse a sentence and want to remove selected words from the middle.
Consider:
dim a() as object = split(mySentence)
for each w in a() select case w case w.startswith("X") 'code to remove this specific word from the array end select next
result = join(a)
Can't find a way to remove the word. Any help out there?
\\\
Dim al As New ArrayList()
al.InsertRange(0, Split("Hello World Test", " "))
For Each Item As String In al
MsgBox(Item)
Next Item
///
- or -
\\\
Imports System.Collections.Specialized
..
..
..
Dim s As New StringCollection()
s.AddRange(Split("Hello World Test", " "))
....
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Herfried, perfect. Thanks.
Jeremy
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ON*************@TK2MSFTNGP12.phx.gbl... "Jeremy" <je****@ninprodata.com> schrieb: I'm trying to parse a sentence and want to remove selected words from the middle.
Consider:
dim a() as object = split(mySentence)
for each w in a() select case w case w.startswith("X") 'code to remove this specific word from the array end select next
result = join(a)
Can't find a way to remove the word. Any help out there?
\\\ Dim al As New ArrayList() al.InsertRange(0, Split("Hello World Test", " ")) For Each Item As String In al MsgBox(Item) Next Item ///
- or -
\\\ Imports System.Collections.Specialized . . . Dim s As New StringCollection() s.AddRange(Split("Hello World Test", " ")) ... ///
-- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Sam Collett |
last post by:
How do I remove an item with a specified value from an array?
i.e. array values 1,2,2,5,7,12,15,21
remove 2 from array would return
1,5,7,12,15,21
(12 and 21 are NOT removed, duplicates are...
|
by: Rimuen |
last post by:
Have a string contains numbers from database. But there is similar numbers
want to remove
Example:
1,3,6,6,6,12,13,14,15,15,15,15
Want to remove the similar numbers so it would be like:...
|
by: koperenkogel |
last post by:
Dear cpp-ians,
I am working with a vector of structures.
vector <meta_segment> meta_segm (2421500);
and the structure look like:
struct meta_segment
{
float id;
float num;
|
by: Derek Basch |
last post by:
I can remove objects from an array by doing this:
for (i in oCache){
if (i == "test"){
delete oCache;
};
};
However, the array's length property is unaffected.
|
by: Don |
last post by:
My user control has a combobox with an arraylist attached to it along with custom add and remove methods.
The "Add" method is working great. However I don't understand why the "Remove" method...
|
by: eksamor |
last post by:
I have a simple linked list:
struct element {
struct element *next;
int start;
};
struct list {
struct element *head;
|
by: oLgAa25 |
last post by:
Hello all,
I am back
I have this question
everything compiles fine, but I just need to check for an index that is
more than the array size. Although it says out of bound, but it is
still...
|
by: Richard Maher |
last post by:
Hi,
I have read many of the copius entries on the subject of IE performance (or
the lack thereof) when populating Select Lists.
I don't mind the insert performance so much, (I get 100x120byte...
|
by: Barkingmadscot |
last post by:
I am stuck, i can workout how to remove lines from an array
I have loading a text file (a Log), I know which lines a need, but
the logs can be upto 30K sometimes bigger. I found trying to...
|
by: tedpottel |
last post by:
Help
How can I remove an item from an array,
Example
Array=3, array=6 array=7 array=9
Is there a way to remove a item, say index 1, so the array would now
be
Array=3 array=7 array=9 ?????
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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...
| |