Skip to content

String Manipulation Opcodes

These opcodes perform operations on string variables (note: most of the opcodes run at init time only, and have a version with a "k" suffix that runs at both init and performance time; exceptions to this rule include puts and strget):

  • evalstr - Evaluates a string containing Csound code, returning a value.
  • return - Returns a value from an instrument.
  • strcpy and strcpyk - Assigns to a string variable.
  • strcat and strcatk - Concatenates strings, and stores the result in a variable.
  • strcmp and strcmpk - Compares strings.
  • strget - Assigns to a string variable, from strset table at the specified index, or string score p-field.
  • strlen and strlenk - Returns the length of a string.
  • sprintf - printf-style formatted output conversion, storing the result in a string variable.
  • sprintfk - printf-style formatted output conversion, storing the result in a string variable at k-rate.
  • puts - Prints a string constant or variable.
  • strindex and strindexk - Returns the first occurence of a string in another string.
  • strrindex and strrindexk - Returns the last occurence of a string in another string.
  • strsub and strsubk - Returns a substring of the input string.
  • strstrip - Strip whitespace from string.

strfromurl sets a string variable at initialization time to the value found from reading an URL.