Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Single occurrence in a string
Message
De
02/04/2015 20:42:50
 
 
À
02/04/2015 15:32:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01617326
Message ID:
01617735
Vues:
54
>>Hi All:
>>
>>How do I remove duplicate characters in a string:
>>
>>
>>Bigstring = 'cattttccv'
>>NonDupeString = NonDupe(BigString)
>>
>>* Result = 'catv'
>>
>>
>>Thanks,
>>
>>Yossi
>
>FWLIW, My VFP solution, after reading Dragan's, was the same as Walter's except that I used CHRTRAN rather than STRTRAN.
>
>My last APL coding was back in 1984. I've been trying to work out a solution, but I've forgotten too much.
>So far all I can come up with is
>
>teststring <-  teststring[< gradeup > teststring]  
>bitmap <-  !=\teststring 
>result <- bitmap / teststring.
>
>(not sure if I remember exactly how not equal scan works. I "think" (hope) it gives a 1 when the values change.
>
>Of course, if it were real APL it would be in one line
>
>
>But I think I would be able to understand the real solution when I see it.
>
>(Sorry Craig. I don't have the keyboard to show the proper glyphs for you)

Perhaps you can utilize the information on the following page to present the code?
http://aplwiki.com/UnicodeForAplers#HTML_Specialties

% ' ⍺ ⍵ _ a b c d e f g h i j k l m n o p q r s t u v w x y z ¯
. ⍬ 0 1 2 3 4 5 6 7 8 9 ¤ ¥ $ £
¢ ∆ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ý ⍙ Ê Ë
Ò Ó Ô Õ þ ð { € } ⊣ ⌷ ¨ ⍨ [ / ⌿
\ ⍀ < ≤ = ≥ > ≠ ∨ ∧ - + ÷ × ? ∊
⍴ ~ ↑ ↓ ⍳ ○ * ⌈ ⌊ ∇ ∘ ⊂ ⊃ ∩ ∪ ⊥
⊤ | ; , ⍱ ⍲ ⍒ ⍋ ⍉ ⌽ ⊖ ⍟ ⌹ ! ⍕ ⍎
⍫ ⍪ ≡ ≢ ø " #  & ’ │ @ ^ ‘ ∣
⍷ ⋄ ← → ⍝ ) ] § ⎕ ⍞ ⍣ ⍐ ⍗ ⍇ ⍈

(assuming of course a Web browser that can display the right symbols is being used).
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform