Re: Counting characters and splitting string
- From: "Steve" <Sorry@xxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 21 Jul 2007 15:07:44 GMT
1. The Instr function finds the occurrence of one string within another.
The OP needs to build a routine around the InStr function.
2. Brain was working faster than fingers! MyArray(i) = Mid(i,1) should be:
MyArray(i) = Mid([MyString],i,1)
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@xxxxxxxxxxxxxxx
"Larry Linson" <bouncer@xxxxxxxxxxxxx> wrote in message
news:mhfoi.516$7w.381@xxxxxxxxxxx
Could you clarify, Steve? Your first suggestion appears incomplete and
the second does not seem to work, even if MyString is
dimensioned/provided.
"Steve" <Sorry@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:AV9oi.8859$rR.6112@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1. Look at the Instr function in the Help file.
2. Dim i As Integer
Dim MyArray As Variant
For i = 1 to Len(MyString)
MyArray(i) = Mid(i,1)
Next i
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@xxxxxxxxxxxxxxx
"John" <xxx@xxxxxxx> wrote in message
news:f7r88a$jg4$1@xxxxxxxxxxxxxxxxxxxxxx
1. Is there an easy function in VB to count for instance the number of
A's in a string?
2. Is there an easy funtion in VB to pull all characters out of a string
into an array? (I tried the split function but that needs a separator.)
Thanks,
john
.
- References:
- Counting characters and splitting string
- From: John
- Re: Counting characters and splitting string
- From: Steve
- Re: Counting characters and splitting string
- From: Larry Linson
- Counting characters and splitting string
- Prev by Date: join table based on Time comparison
- Next by Date: Re: join table based on Time comparison
- Previous by thread: Re: Counting characters and splitting string
- Next by thread: Re: Counting characters and splitting string
- Index(es):
Relevant Pages
|