Article 3T1H5 Representative Line: Got Your Number

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:

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.

buildmaster-icon.png [Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how! TheDailyWtf?d=yIl2AUoC8zAtBrJ7DQO-8Q
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments