Flip Text using Coldfusion

Gurpreet Singh Randhawa
Gurpreet Singh Randhawa used Ask the Experts™
on
How can i flip the TEXT using Coldfusion or java Technique.

just like fliptext.org
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
reverse function in cf

Reverse Example

<cfif IsDefined("FORM.myString")>

      <cfoutput>#Reverse(FORM.myString)#</cfoutput>

</cfif>

<form method="post">
<p>Enter a string to be reversed:
<input type = "Text" name = "MyString">
<p><input type = "Submit" name = "">
</form>


No it isn not reverse. It is flip text, i mean upside down what we write like i write:

Hello Sir

Flip text will be like:

y1s o11Ýe
oops sorry , I thought reverse blame my old age :))
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

Alright so how i do the same
there are some JS stuff did u tried using them .but check them for browser issues
i really do not know if you can point me to some JS stuff or unicodes support for what i need to make it work. Please paste some contents here

Cheers
see this url he is using js

check the code in view source
save this as html file and run it .


<style type="text/css">
textarea { font-family: "Arial Unicode MS", Batang }
h1 { margin-bottom: 2px;}
</style>
<script>
function flip() {
 var result = flipString(document.f.original.value.toLowerCase());
 document.f.flipped.value = result;
}
 
function flipString(aString) {
 var last = aString.length - 1;
 //Thanks to Brook Monroe for the suggestion to use Array.join
 var result = new Array(aString.length)
 for (var i = last; i >= 0; --i) {
  var c = aString.charAt(i)
  var r = flipTable[c]
  result[last - i] = r ? r : c
 }
 return result.join('')
}
 
var flipTable = {
a : '\u0250',
b : 'q',
c : '\u0254', //open o -- from pne
d : 'p',
e : '\u01DD',
f : '\u025F', //from pne
g : '\u0183',
h : '\u0265',
i : '\u0131', //from pne
j : '\u027E',
k : '\u029E',
//l : '\u0283',
m : '\u026F',
n : 'u',
r : '\u0279',
t : '\u0287',
v : '\u028C',
w : '\u028D',
y : '\u028E',
'.' : '\u02D9',
'[' : ']',
'(' : ')',
'{' : '}',
'?' : '\u00BF', //from pne
'!' : '\u00A1',
"\'" : ',',
'<' : '>',
'_' : '\u203E',
'\u203F' : '\u2040',
'\u2045' : '\u2046',
'\u2234' : '\u2235',
'\r' : '\n' //thank you, Yeeliberto
}
 
for (i in flipTable) {
  flipTable[flipTable[i]] = i
}
</script></head><body>
<h1>Flip</h1>
<form name="f">Original:
<br>
<textarea rows="5" cols="50" name="original" onkeyup="flip()"></textarea> <input value="Flip" onclick="flip()" type="button">
 
<br>
Flipped:
<br>
<textarea rows="5" cols="50" name="flipped"></textarea>
</form>

Open in new window

where is the link Dude!
here is the link
http://www.revfad.com/flip.html

but i pasted the code right , you can use the same
Thanks I wanna know one thing:

what is this all about if you can explain me plase

var flipTable = {
a : '\u0250',
b : 'q',
c : '\u0254', //open o -- from pne
d : 'p',
e : '\u01DD',
f : '\u025F', //from pne
g : '\u0183',
h : '\u0265',
i : '\u0131', //from pne
j : '\u027E',
k : '\u029E',
//l : '\u0283',
m : '\u026F',
n : 'u',
r : '\u0279',
t : '\u0287',
v : '\u028C',
w : '\u028D',
y : '\u028E',
'.' : '\u02D9',
'[' : ']',
'(' : ')',
'{' : '}',
'?' : '\u00BF', //from pne
'!' : '\u00A1',
"\'" : ',',
'<' : '>',
'_' : '\u203E',
'\u203F' : '\u2040',
'\u2045' : '\u2046',
'\u2234' : '\u2235',
'\r' : '\n' //thank you, Yeeliberto
}

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial