Monday, October 19, 2009
Function waste_cycles(cyclesToWaste)
<% Function compare_strings(aszString1,aszString2)
'Declare variables
dim intresult, strtemp1, strtemp2, arrString1, arrString2
'Split string to get the individual substrings
arrString1 = Split(aszString1)
arrString2 = Split(aszString2)
'Join the elements of the array with no delimiter
strtemp1=join(arrString1,"")
strtemp2=join(arrString2,"")
'Compare the two strings
intresult=StrComp(strtemp1,strtemp2,vbTextCompare)
'Return
compare_strings = intresult
end function %>
Seriously? Seeing as how the default delimiter when you split in vbScript is a space... this function is specifically designed to compare strings where all of the spaces were typed by someone during an earthquake.
(submitted by DasUberDog)
Labels:
Code,
Redundancy
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment