Java Utililty Methods String Blur

List of utility methods to do String Blur

Description

The list of methods to do String Blur are organized into topic(s).

Method

Stringblur(String s)
replaces everything but the first and last letter of the input string s by '.'
if (!BLUR)
    return s;
if (s == null || s.length() <= 1)
    return s;
char c[] = s.toCharArray();
for (int i = 1; i < s.length() - 1; i++)
    c[i] = '.';
return new String(c);
...
StringblurKeepingExtension(String s)
blurs a filename but keeps the extension intact.
if (s == null)
    return null;
int idx = s.lastIndexOf(".");
if (idx <= 0)
    return blur(s); 
int MAX_EXTENSION_LENGTH = 6;
if (s.length() - idx > MAX_EXTENSION_LENGTH)
    return blur(s); 
...