Java – how to flip a letter upside down?

Here, I want to turn an English letter upside down my email template

Then I can get it manually. What I'm doing now is manual

Like

content.append("ɥ"); //actual h letter.
 content.append("ǝ")// actual e letter.

So my question is, is there any technique / method / any clue to do it programmatically?

What am I doing now

switch(letter) {

case 'e':
   return 'ǝ';
}

This looks strange. Look for tips Thank you for any help

Solution

Try this script, here: http://ideone.com/szPg6V

Input:

"So my question is, in a procedural way?

Ouput:

>,¿ ʎɐʍɔɔʇɐɯɯɐɹʇɐɯɯɐɹɹʇʇʇʇǝǝʎʎɐǝɹǝɥʇǝɹǝɥʇǝɹǝɥʇǝɹǝɥʇʇɐɥʇʇɐɥʇʇɐɥʇʇɐɥʇʇɐɥʇʇɐɥʇʇɐɥʇʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯʎɯ

Java code:

String normal = "abcdefghijklmnopqrstuvwxyz_,;.?!/\\'";
String split  = "ɐqɔpǝɟbɥıظʞןɯuodbɹsʇnʌʍxʎz‾'؛˙¿¡/\\,";
//maj
normal += "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
split  += "∀qϽᗡƎℲƃHIſʞ˥WNOԀὉᴚS⊥∩ΛMXʎZ";
//number
normal += "0123456789";
split  += "0ƖᄅƐㄣϛ9ㄥ86";

String str = "So my question is that,is there any trick/method/any clue to do it in programmatic way ?";
String newstr = ""; 
char letter;
for (int i=0; i< str.length(); i++) {
    letter = str.charAt(i);

    int a = normal.indexOf(letter);
    newstr += (a != -1) ? split.charAt(a) : letter;
}
System.out.println(new StringBuilder(newstr).reverse().toString());

I use this tool: http://www.upsidedowntext.com/

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>