Skip to content
Chris Petersen edited this page Oct 16, 2014 · 1 revision

string-contains return the index of the first occurrence of pattern in str.

Parameter Description
str Input string
pattern The pattern string to look for

Example

Example 1: Helper function in redcap module to split return string into header and body

(define (redcap:split-headerbody str)
  (set! a (string->list str))
  (let ((pos (string-contains str "\r\n\r\n")))
    (if pos 
      (list (substring str 0 pos) (substring str (+ pos 4) (string-length str))) 
      (list str (list)))
  ))
Clone this wiki locally