Naming Conventions |
|||||
|
Scalar |
Vector |
Matrix |
Any |
Non- |
Boolean |
BS |
BV |
BM |
BA |
BN |
Integer |
IS |
IV |
IM |
IA |
IN |
Float |
FS |
FV |
FM |
FA |
FN |
Numeric |
NS |
NV |
NM |
NA |
NN |
Character |
CS |
CV |
CM |
CA |
CN |
Enclosed |
ES |
EV |
EM |
EA |
EN |
enclosed |
TS |
TV |
TM |
TA |
TN |
Simple |
SS |
SV |
SM |
SA |
SN |
Any |
AS |
AV |
AM |
AA |
AN |
phrase e.g.: .X...Y. ⍝ X←BS; Y←IV |
|||||
combinations: use ISV for Integer scalar∨vector |
|||||
B3, I4 &c. to specify higher ranks. |
|||||
DeleteTrailingBlanks
The task to delete trailing blanks from a string is a very common one. APL dialects might provide a utility function for this. Common names are rtb (remove trailing blanks) and dtb (delete trailing blanks). There are a couple of approaches available but one which is supposed to run in all flavours of APL is this one:
(-+/∧\' '=⌽CV)↓CV
Examples
⎕FX ⊃'r←dtb cv' 'r←(-+/∧\'' ''=⌽cv)↓cv'
(dtb 'Hello, world '),'|'
Hello, world|
Specialities
Dyalog
Show more information
Compatibility
Checked with: APL21, APLX, Dyalog, NARS2000
Test Cases
Show test cases
Test my code, both Examples and Test Cases.
See also: DeleteLeadingBlanks and DeleteMultipleBlanks
Mentor: KaiJaeger
Tags: <Blanks> <DeleteBlanks> <RemoveBlanks>
CategoryPhrasesAll - CategoryPhraseCharacterManipulation
APL2: see Apl2Problems (1)
APL Wiki