各位麻烦看一下:
      我见过的一个程序中有下面的代码:
       ..............
       var 
          tempstr,sepchar:string;
          begin 
            if tempstr >= sepchar   then
                ..........
                 ..........             假设在此 tempstr 和sepchar 均为一个字符
              那么  tempstr >= sepchar   是什么意思呢?
               两个字符串如何比较呢?
               谢谢 各位!请帮小弟一下 ,多谢!!
  
                   
           

解决方案 »

  1.   

    它返回的是布尔值呀!两个字符相同就是TRUE,否则就是FALSE
      

  2.   

    一般用 StrComp 之類的比較函數比較好!
    >>  tempstr >= sepchar   是什么意思呢?
    比較的是兩個串的 Ascii 碼的大小!
      

  3.   

    呵呵,帮助:
    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.
      

  4.   


      frogshero(三波萝) 
        多谢你了!
      
      

  5.   

    字符串的比较是字符串对应字符序数值的比较对于字符串长度等于1的情况,单纯比较惟一字符的ASCII值!
      

  6.   

    比较 第一个 字符的ascII  如果第一个 相同 就 比较第二个