1. String Pure Intercept
Salinan kode adalah sebagai berikut:
functioncutstr (thestr1, strlen)
DIML, T, C.
l = len (thestr1)
ifl <1thenexitfunction
t = 0
fordxy1 = 1Tol
c = abs (ASC (mid (thestr1, dxy1,1))))
ifc> 255then
t = t+2
kalau tidak
t = t+1
endif
IFT> = Strlenthen
thev = mid (thestr1,1, dxy1)
keluar
kalau tidak
thev = thestr1
endif
Berikutnya
cutstr = thev
fungsi endfungsi
2. Mencegat string, gunakan ruang untuk mengisinya
Salinan kode adalah sebagai berikut:
functioncutstr (thestr, strlen)
DIML, T, C.
l = len (thestr)
t = 0
fordxy = 1Tol
c = abs (ASC (mid (thestr, dxy, 1)))))
ifc> 255then
t = t+2
kalau tidak
t = t+1
endif
IFT> = Strlenthen
thev = kiri (thestr, dxy)
keluar
kalau tidak
bu = strlen-t
forbui = 1tobu
strbu = ""
strbucall = strbucall & strbu
Berikutnya
thev = thestr & strbull
strbu = ""
strbucall = ""
endif
Berikutnya
cutstr = thev
fungsi endfungsi