www.pudn.com > sale.rar > format.chs


<% 
function formatstr(str,sub_str,rp_str) 
	dim position 
	dim ls_position 
	dim leftstr 
	dim rightstr 
	dim lsstr 
	dim flag 
	flag=false 
 
	position=0 
	ls_position=len(str) 
	do while ls_position<>0 
		position=instr(position+1,str,sub_str,1) 
		if position>0 then 
			leftstr=left(str,position-1) 
			if len(sub_str)>1 then 
				rightstr=right(str,ls_position-position-(len(sub_str)-1)) 
			else 
				rightstr=right(str,ls_position-position) 
			end if 
			lsstr=left(rightstr,1) 
			for i=0 to 255 
				if lsstr=chr(i) then  
					flag=true 
					exit for 
					'response.write chr(i) 
					'response.write "
" & lsstr end if response.write "chr(" & i & ")กก" & chr(i) & "กก" response.write "lsstr:" & lsstr & "
" next 'response.write "
" & lsstr if flag=true then 'str=leftstr & rp_str & rightstr 'ls_position=len(str) 'position=0 flag=false position=position+len(rp_str) else position=position+len(rp_str) str=leftstr & rp_str & rightstr ls_position=len(str) 'position=0 'flag=false end if else ls_position=0 end if loop formatstr=str end function %>