How To Remove A Word in A Text File

jothis

Active Member
Licensed User
Hi, All

This is My Code
B4X:
               file=AppPath&"\Devices.txt"
                If(FileExist(file))Then
      FileOpen(con1,file,cRead,cASCII)
      line=FileRead(con1)
      Do While Line<>EOF
      Data()=StrSplit(Line,"=")
      If SubString(Data(0), 0, 6) = "Source" Then
         ListBox1.Add(Data(1))
      End If
      Line=FileRead(con1)
   Loop
      FileClose(con1)
   Else
    Msgbox("UNABLE TO OPEN FILE")
End If
And This is My Text File
Source1=HP psc 1400 series TWAIN
Source2=WIA-HP psc 1400 series
Source3=HP Scanjet N6010 TWAIN
Source4=WIA-HP Scanjet N6010 TWAIN

This is A Text File of The Currently Installed Scanner

My Problem Is I Dont Want To See The WIA Devices In My Listbox

Can You Help Me For This Problem?
Jothis
:sign0085:
 

Erel

B4X founder
Staff member
Licensed User
Longtime User

jothis

Active Member
Licensed User
Thankyou Erel

Thank you For Helping Me Erel. It Is A Nice Library
jothis
:sign0060:
 

Discorez

Member
Licensed User
Longtime User
StringsEx.StartsWith
Or simple analog without library:

B4X:
Sub StartWith(sSource, sLook) As Boolean
   If StrIndexOf(sSource, sLook, 0) = 0 Then Return True Else Return False
End Sub
 
Top