Created
April 7, 2011 21:15
-
-
Save raymcdermott/908742 to your computer and use it in GitHub Desktop.
simple recursion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def scrubOut(line: String, keys: Seq[String]): String = { | |
// Optimizations... most likely to the left | |
if (!line.contains("=") || !line.contains("\"") || keys.isEmpty || containsKeys(false, line, keys) == false) | |
line | |
else | |
scrubOut(line.replaceAll(keys.head + "=\".*?\"", keys.head + "=\"****\""), keys.tail) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment