aboutsummaryrefslogtreecommitdiff
path: root/unix/boot/spp/rpp/ratlibr/sdrop.r
blob: fb3169cd10716dab8fc4d4ee25ca8bb9ed9a013b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
include	defs

# sdrop --- drop characters from a string APL-style

   integer function sdrop (from, to, chars)
   character from (ARB), to (ARB)
   integer chars

   integer len, start
   integer ctoc, length, min0

   len = length (from)
   if (chars < 0)
      return (ctoc (from, to, len + chars + 1))
   else {
      start = min0 (chars, len)
      return (ctoc (from (start + 1), to, len + 1))
      }

   end