02-18-2012, 08:36 AM
i am bit not clear with what data u get either whole "I am in [London] for 1 week" or "[London]"
anyway try below to remove brackets and get data. and do if for compare, bit easy only.
Case1:
Case2:
anyway try below to remove brackets and get data. and do if for compare, bit easy only.
Case1:
Code:
data ="I am in [London] for 1 week"
startpos=inStr(data ,"[")
endpos =inStrRev(data,"]")
required=mid(data,startpos+1,(endpos-startpos-1))
msgbox(required)
Case2:
Code:
data="[London]"
required=mid(data,2,(Len(data)-2))
msgbox(required)