To specify a constant string, it must be enclosed in single-quotes, just as a Char type, only now more than one character is allowed. Given that S is of type String, the following are valid assignments:
S := 'This is a string.'; S := 'One'+', Two'+', Three'; S := 'This isn''t difficult !'; S := 'This is a weird character : '#145' !'; |
Whether the constant string is stored as an ansistring or a short string depends on the settings of the {$H} switch.