码迷,mamicode.com
首页 > Windows程序 > 详细

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

时间:2014-11-07 09:50:58      阅读:196      评论:0      收藏:0      [点我收藏+]

标签: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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!