各位麻烦看一下:
我见过的一个程序中有下面的代码:
..............
var
tempstr,sepchar:string;
begin
if tempstr >= sepchar then
..........
.......... 假设在此 tempstr 和sepchar 均为一个字符
那么 tempstr >= sepchar 是什么意思呢?
两个字符串如何比较呢?
谢谢 各位!请帮小弟一下 ,多谢!!
我见过的一个程序中有下面的代码:
..............
var
tempstr,sepchar:string;
begin
if tempstr >= sepchar then
..........
.......... 假设在此 tempstr 和sepchar 均为一个字符
那么 tempstr >= sepchar 是什么意思呢?
两个字符串如何比较呢?
谢谢 各位!请帮小弟一下 ,多谢!!
>> tempstr >= sepchar 是什么意思呢?
比較的是兩個串的 Ascii 碼的大小!
Compares two strings by ordinal value without case sensitivity.
---看大小就是指字符ord('字符')的大小 ---》ordinal value
UnitSysUtilsCategorystring handling routinesDelphi syntax:function CompareText(const S1, S2: string): Integer;C++ syntax:extern PACKAGE int __fastcall CompareText(const AnsiString S1, const AnsiString S2);DescriptionCompareText compares S1 and S2 and returns 0 if they are equal. If S1 is greater than S2, CompareText returns an integer greater than 0. If S1 is less than S2, CompareText returns an integer less than 0. CompareText is not case sensitive and is not affected by the current locale.
frogshero(三波萝)
多谢你了!