Next: , Previous: , Up: bytevectors 8   [Index]


27.2.11 Padding and trimming

Function: %bytevector-s8-pad requested-len fill bv start past
Function: %bytevector-u8-pad requested-len fill bv start past
Function: %bytevector-s8-pad-right requested-len fill bv start past
Function: %bytevector-u8-pad-right requested-len fill bv start past
Macro: bytevector-s8-pad B requested-len
Macro: bytevector-u8-pad B requested-len
Macro: bytevector-s8-pad B requested-len fill
Macro: bytevector-u8-pad B requested-len fill
Macro: bytevector-s8-pad-right B requested-len
Macro: bytevector-u8-pad-right B requested-len
Macro: bytevector-s8-pad-right B requested-len fill
Macro: bytevector-u8-pad-right B requested-len fill

Build a bytevector of length requested-len comprised of bv padded on the left or right by as many occurrences of the byte or character fill as needed. Always return a newly allocated bytevector.

If bv has more than requested-len bytes, it is truncated on the left or right to length requested-len. For the macros: fill defaults to the byte representing #\space in ASCII encoding.

Function: %bytevector-s8-trim byte/char/char-set/pred bv start past
Function: %bytevector-u8-trim byte/char/char-set/pred bv start past
Function: %bytevector-s8-trim-right byte/char/char-set/pred bv start past
Function: %bytevector-u8-trim-right byte/char/char-set/pred bv start past
Function: %bytevector-s8-trim-both byte/char/char-set/pred bv start past
Function: %bytevector-u8-trim-both byte/char/char-set/pred bv start past
Macro: bytevector-s8-trim B byte/char/char-set/pred
Macro: bytevector-u8-trim B byte/char/char-set/pred
Macro: bytevector-s8-trim-right B byte/char/char-set/pred
Macro: bytevector-u8-trim-right B byte/char/char-set/pred
Macro: bytevector-s8-trim-both B byte/char/char-set/pred
Macro: bytevector-u8-trim-both B byte/char/char-set/pred

Trim bv by skipping over all bytes on the left/on the right/on both sides that satisfy the second parameter byte/char/char-set/pred:

Always return a newly allocated bytevector.


Next: , Previous: , Up: bytevectors 8   [Index]