Representative Line: Got Your Number
by Remy Porter from The Daily WTF on (#3T1H5)
You have a string. It contains numbers. You want to turn those numbers into all "0"s, presumably to anonymize them. You're also an utter incompetent. What do you do?
You already know what they do. Jane's co-worker encountered this solution, and she tells us that the language was "Visual BASIC, Profanity".
Private Function ReplaceNumbersWithZeros(ByVal strText As String) As String ReplaceNumbersWithZeros = Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(strText, "1", "0"), "2", "0"), "3", "0"), "4", "0"), "5", "0"), "6", "0"), "7", "0"), "8", "0"), "9", "0")End Function
Jane adds:
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!My co-worker found this function while researching some legacy code. Shortly after this discovery, it took us 15 minutes to talk him down off the ledge"and we're on the ground floor.