Data structure-4.1 strings, arrays and generalized tables

Data structure-4.1 strings, arrays and generalized tables

Preface-Data Structure

The data structure needs to be chewed repeatedly, and the answers to the problems encountered in the development can be obtained at any time.

string

  • Definition of string A
    finite sequence of zero or more characters.
    Denoted as S='a1a2…an' (n>=0)
  • String term
    • String name: S:
    • String value: A sequence of characters enclosed in single quotes.
    • Length: the number of characters in the string
    • Empty string: a string containing zero characters, 0 means.
    • Space string: A string consisting of one or more spaces.
    • Substring: A subsequence composed of any consecutive characters in a string.
    • The position of the character in the string: the serial number of the character in the sequence)
    • The position of the substring in the string: the position of the first character of the substring in the string.
    • Equal: if and only if the values ​​of the two strings are equal.
  • Examples of strings
    Insert picture description here
  • String comparisonInsert picture description here

Guess you like

Origin blog.csdn.net/weixin_41732253/article/details/109503956