delphi字符函数Copy,Pos,Quotedstr

----------------------------------------------------------------------------------------------
Pos function
Returns the index value of the first character in a specified substring that occurs in a given string.


Unit
System


Category
string handling routines
function Pos(Substr: string; S: string): Integer;


Description
Pos searches for a substring, Substr, in a string, S. Substr and S are string-type expressions.


Pos searches for Substr within S and returns an integer value that is the index of the first character of Substr within S. Pos is case-sensitive. If Substr is not found, Pos returns zero.If the substr located at the first place, then return 1;


-------------------------------------------------------------------------------------------------
Copy function
Returns a substring of a string or a segment of a dynamic array.


Unit
System


Category
string handling routines
function Copy(S; Index, Count: Integer): string;
function Copy(S; Index, Count: Integer): array;


Description
S is an expression of a string or dynamic-array type. Index and Count are integer-type expressions. Copy returns a substring or sub array containing Count characters or elements starting at S[Index].


If Index is larger than the length of S, Copy returns an empty string or array.
If Count specifies more characters or array elements than are available, only the characters or elements from S[Index] to the end of S are returned.


Note: When S is a dynamic array, Copy can only be used as a parameter in a call to a procedure or function that expects an array parameter. That is, it acts like the Slice function when working with dynamic arrays.
------------------------------------------------------------------------------------------
QuotedStr function
Returns the quoted version of a string.


Unit
SysUtils


Category
String handling routines
function QuotedStr(const S: string): string;


Description
Use QuotedStr to convert the string S to a quoted string. A single quote character (') is inserted at the beginning and end of S, and each single quote character in the string is repeated.


Note: When working with multi-byte character systems (MBCS), use AnsiQuotedStr instead.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值