| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
--nosound |
| 4 |
|
| 5 |
</CsOptions> |
| 6 |
|
| 7 |
<CsInstruments> |
| 8 |
|
| 9 |
/* strstrip: strip whitespace from string |
| 10 |
|
| 11 |
Sout strstrip Sin [, Smode] |
| 12 |
|
| 13 |
Args |
| 14 |
Sin - string to strip whitespace from |
| 15 |
Smode - if not given, whitespace is stripped from left and right edges |
| 16 |
"l" - strip whitespace from left edge only |
| 17 |
"r" - strip whitespace from right edge only |
| 18 |
*/ |
| 19 |
|
| 20 |
instr 1 |
| 21 |
Sout = strstrip(" \t\n foo bar \t\n") |
| 22 |
; Sout = strstrip(" center ", "l") |
| 23 |
; Sout = strstrip(" center ", "r") |
| 24 |
|
| 25 |
prints "string: '%s'\n", Sout |
| 26 |
turnoff |
| 27 |
endin |
| 28 |
|
| 29 |
</CsInstruments> |
| 30 |
|
| 31 |
<CsScore> |
| 32 |
|
| 33 |
i1 0 1 |
| 34 |
|
| 35 |
</CsScore> |
| 36 |
</CsoundSynthesizer> |