
Removing Line based on First Character
Quote:
> Hi,
> Does anyone have an idea for removing a line based on the first
> character(s)? For example if I have "rem This is a comment in system files"
> Then that line would be removed from the string containing it.
Hi,
I guess you read this string from a file.
Read the file line-by-line instead and skip every line which starts with REM
myString=""
open"myfile" for input as #1
while not eof(1)
line input#1,x
if ucase(left(x,4))="REM " then
'skip
else
'append
myString=myString & vbCrLf & x
endif
wend
close#1
HTH
Michaela