refer to
http://forums.vb-world.net/showthrea...threadid=40051
now please
Printable View
refer to
http://forums.vb-world.net/showthrea...threadid=40051
now please
: "." and "," and "?" and "'" and "-".
a text field is it a file and if so give a few lines
from the file and if it is comma delimited or not.
the special characters...does it mean you don't count those as an ending..example jack ate melon. means you want to leave the . and end up with this kjacay eatay nmeloay.
the way this thing works is that i input from a text file like this:
To be or not to be, -that is the question : -Whether 'tis nobler in the mind to suffer the slings and arrows of outrageous fortune... and so on
what i have to do is find issolate every word and move the first letter of that word to the end and add "ay" to the end of the same word. So it looks like this:
Hello Sir.
elloHay irSay. Pig Latin
how do i do this, please help
Here is a start..this will seperate the words.
[code]
Option Explicit
Public Function Split2(ByVal sString As String, ByVal sSeparator As String) As Variant
Dim sParts() As String
Dim lParts As Long
Dim lPos As Long
lPos = InStr(sString, sSeparator)
While lPos
ReDim Preserve sParts(lParts)
sParts(lParts) = Left(sString, lPos - 1)
sString = Mid(sString, lPos + Len(sSeparator))
lPos = InStr(sString, sSeparator)
lParts = lParts + 1
Wend
If Len(sString) Then
ReDim Preserve sParts(lParts)
sParts(lParts) = sString
End If
Split2 = IIf(lParts, sParts, Array())
End Function
Private Sub Command1_Click()
Dim sMyFile As String
Dim intNum As Integer
'open for binary and read it into a string
sMyFile = "C:\My Documents\MyFile.txt"
intNum = FreeFile
Open sMyFile For Binary As intNum
myString = Space(LOF(intNum))
Get #intNum, , myString
Close intNum
Dim vLines As Variant
Dim lLine As Long
Dim sLet As String
vLines = Split2(myString, " ")
For lLine = 0 To UBound(vLines)
List1.AddItem vLines(lLine)
Next
End Sub
[code]
[Edited by HeSaidJoe on 11-14-2000 at 08:46 PM]