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. |
|||||
DeleteLeadingBlanks
The task to delete leading blanks from a string is a very common one. APL dialects might provide a utility function for this. Common names are rlb (remove leading blanks) and dlb (delete leading blanks).
There are a couple of approaches available but one which is supposed to run in almost all flavours of APL is this one:
(+/∧\' '=CV)↓CV
Examples
⎕FX ⊃'r←dlb cv' 'r←(+/∧\'' ''=cv)↓cv'
'|',( dlb' hello world '),'|'
|hello world |
Specialities
Dyalog
This dfn (direct function):
{(+/∧\' '=⍵)↓⍵}is recognized in Dyalog as an Idiom and therefore recognized as such and executed faster than the ordinary APL expression.
Compatibility
CheckedWith: APL2, APLX, Dyalog, NARS2000
Test Cases
Show test cases
Test my code, both Examples and Test Cases.
See also: DeleteTrailingBlanks and DeleteMultipleBlanks
Mentor: KaiJaeger
Tags: <Blanks> <DeleteBlanks> <RemoveBlanks>
APL Wiki