delphi 单引号在字符串中使用方法

2020-12-13 16:12

阅读:284

标签:style   io   ar   os   使用   sp   for   on   问题   

可以看delph的帮助,里面有这个问题详细说明:
A character string, also called a string literal or string constant, consists of a quoted string, a control string, or a combination of quoted and control strings. Separators can occur only within quoted strings.

A quoted string is a sequence of up to 255 characters from the extended ASCII character set, written on one line and enclosed by apostrophes. A quoted string with nothing between the apostrophes is a null string. Two sequential apostrophes in a quoted string denote a single character, namely an apostrophe. For example,

‘BORLAND‘           { BORLAND }  //字符
‘You‘‘ll see‘       { You‘ll see }     //两个‘连接在一起代表字符中的一个‘号.
‘‘‘‘                { ‘ }   同上.
‘‘                  { null string }  //空值
‘ ‘                 { a space }       //一个空格

 

示例:
SQL语句:  where usename like ‘%张三%‘
str1 :=‘where ‘ + FieldName + ‘ like ‘ + ‘‘‘%‘ + SearchBuffer + ‘%‘‘‘       

 

delphi 单引号在字符串中使用方法

标签:style   io   ar   os   使用   sp   for   on   问题   

原文地址:http://www.cnblogs.com/smartlittleant/p/4080433.html


评论


亲,登录后才可以留言!