来自万一老师博客:http://www.cnblogs.com/del/archive/2008/03/31/1131803.html
------------------------------------------------------------------------------------------------
CompareStr 区分大小写; CompareText 不区分大小写. 举例:
var s1,s2: string; i: Integer; begin s1 := 'abc'; s2 := 'adc'; i := CompareStr(s1,s2); ShowMessage(IntToStr(i)); {-2} i := CompareText(s1,s2); ShowMessage(IntToStr(i)); {-2} s1 := 'abc'; s2 := 'ABC'; i := CompareStr(s1,s2); {CompareStr 区分大小写} ShowMessage(IntToStr(i)); {32} i := CompareText(s1,s2); {CompareText 不区分大小写} ShowMessage(IntToStr(i)); {0} end;
============================================================
comparestr()区分大小写 comparetext()不区分大小写 两者都是比较字符串大小 functionCompareSTR(const:s1,s2:String):integer functionCompareText(const:s1,s2:String):integer 大于返回大于0,小于返回小于0,等于返回等于0
来自万一:http://www.cnblogs.com/del/archive/2009/12/07/1618661.html
------------------------------------
var s1,s2: string; b1,b2: Boolean; begin s1 := 'C:\Temp'; s2 := 'c:\temp'; b1 := SameText(s1, s2); //True b2 := s1 = s2; //False ShowMessage(BoolToStr(b1,True) + ' - ' + BoolToStr(b2,True)); end;
2014.01.11--区别:http://bbs.csdn.net/topics/370129887
------------------------------
SameText 返回 Boolean;
SameStr 返回 Boolean;可能区分大小写
CompareStr,CompareText 返回 Integer;
CompareStr 区分大小写
CompareText 不区分大小写