Figure 1 Figure 2 |
Function TranslateImg(Str) Start=instr(str, "[picture]") 'Check the starting position of the mark If start=0 then exit function 'The starting position is 0, which means there is no such mark, then the program ends End=instr(start, str,"[/ Picture]" 'Check the position of the end mark that appears after the start position. If end=0 then exit function 'The position of the end mark is 0, which means there is no end mark and the program ends MidStr=mid(str, start+4, end- start-4) 'Mark the content in the middle ReplaceStr=mid(str, start, end-start+5) 'Mark the content in the middle with a mark as the content to be replaced Str=replace(instr, ReplaceStr,"<img src= ”&MidStr&”>”) 'Translate markup to HTML TranslateImg Str 'Execute this function recursively End Function |