Basic Operations with Strings



This chapter presents some basic procedures for operating with strings and the MATLAB® built-in functions for performing the most commonly required string operations. The chapter is structured as follows, first, in Sect. 4.1, basic functions for searching and comparing strings are presented along with the concept of edit distance. Then, in Sect. 4.2, basic functions and procedures for string replacement and insertion are described. In Sect. 4.3, the specific problems of string segmentation and concatenation are addressed; and in Sect. 4.4 set operations with strings are presented and discussed. Finally, in Sect. 4.5 some illustrative exercises are proposed.


Regular Expression Edit Distance Input String White Space Edit Operation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. Levenshtein V (1966) Binary codes capable of correcting deletions, insertions, and reversals. Sov Phys Dokl 10:707–716MathSciNetGoogle Scholar
  2. Stoll RR (1979) Set theory and logic. Dover Publications, New YorkMATHGoogle Scholar
  3. The MathWorks (2011) MATLAB product documentation. Accessed 2 Nov 2011
  4. Wagner RA, Fischer MJ (1974) The string-to-string correction problem. J ACM 21(1):168–173MathSciNetMATHCrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media New York 2013

Authors and Affiliations

  1. 1.Barcelona

Personalised recommendations