The oldest occurrence I know is from 1918, so much older than the existing answers (at least for its use in mathematics and logic/computation). This is from the book:
C. I. Lewis. A survey of symbolic logic. Berkeley University of California Press, 1918.
For example, on p. 355, he writes (emphasis mine): "A mathematical system is any set of strings of recognisable marks in which some of the strings are taken initially and the remainder derived from these by operations performed according to rules which are independent of any meaning assigned to the marks. That a system should consist of ‘marks’ instead of sounds or odours is immaterial."