RosettaCodeData/Task/Substring/DBL/substring.dbl

13 lines
397 B
Plaintext

;starting from n characters in and of m length;
SUB_STR = STR(n:m)
;starting from n characters in, up to the end of the string;
SUB_STR = STR(n,$LEN(STR))
;whole string minus last character;
SUB_STR = STR(1,%TRIM(STR)-1)
;starting from a known character f within the string and of m length;
;starting from a known substring f within the string and of m length.
SUB_STR = STR(%INSTR(1,STR,f):m)