Re: Find words within range of other word in string?????????
- From: "vonClausowitz" <vonclausowitz@xxxxxxxxx>
- Date: 4 Aug 2006 11:02:13 -0700
Looks great guys, but how does that tell me how far certain words are
away from each other?
Marco
Larry Serflaten schreef:
"expvb" <nobody@xxxxxxx> wrote
Here is a word separator routine that is not based on regular expressions
A little different approach, since all we want are the text characters, we
can simply exclude anything that isn't a character, without having to
define each and every word separator:
LFS
Private Sub Form_Load()
Dim text As String
Dim pos&, idx&
Dim words As New Collection
text = "Just some demo-text, with a few ©dd characters @dded."
For idx = 1 To Len(text)
Select Case Asc(Mid$(text, idx, 1))
Case 65 To 90, 97 To 122
If pos = 0 Then pos = idx
Case Else
If pos > 0 Then
words.Add Mid$(text, pos, idx - pos)
pos = 0
End If
End Select
Next
For idx = 1 To words.Count
Debug.Print idx, words(idx)
Next
End Sub
.
- References:
- Re: Find words within range of other word in string?????????
- From: expvb
- Re: Find words within range of other word in string?????????
- From: Larry Serflaten
- Re: Find words within range of other word in string?????????
- Prev by Date: Re: User-level protection in excel
- Next by Date: Re: Find words within range of other word in string?????????
- Previous by thread: Re: Find words within range of other word in string?????????
- Next by thread: Re: Find words within range of other word in string?????????
- Index(es):
Relevant Pages
|