Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #13898 > unrolled thread
| Started by | Alexei Boulbitch <Alexei.Boulbitch@iee.lu> |
|---|---|
| First post | 2013-03-20 08:22 +0000 |
| Last post | 2013-03-20 08:22 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Swap lowercase and uppercase letters Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2013-03-20 08:22 +0000
| From | Alexei Boulbitch <Alexei.Boulbitch@iee.lu> |
|---|---|
| Date | 2013-03-20 08:22 +0000 |
| Subject | Re: Swap lowercase and uppercase letters |
| Message-ID | <kibrk8$14s$1@smc.vnet.net> |
Hi: I have the following example: "hELLO THERE!" Using Mathematica 8.0.4, how can I swap the lowercase and uppercase letters to output, "Hello there!" Thanks, Bill Hi, Bill, These two functions: revertCharacter[x_String] := If[UpperCaseQ[x], ToLowerCase[x], ToUpperCase[x]]; revertString[string_String]:=Map[revertCharacter,Characters[string]]//StringJoin; do the job in Mathematica 9 at least: revertString@"hELLO THERE!" revertString@"Hello there!" "Hello there!" "hELLO THERE!" I expect that it should also work in the version 8. Have fun, Alexei Alexei BOULBITCH, Dr., habil. IEE S.A. ZAE Weiergewan, 11, rue Edmond Reuter, L-5326 Contern, LUXEMBOURG Office phone : +352-2454-2566 Office fax: +352-2454-3566 mobile phone: +49 151 52 40 66 44 e-mail: alexei.boulbitch@iee.lu
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web