比如 我有如下代码
varstr1,str2:string;
i:integer;......str1:='土木工程';
str2:='土木工程';if str1=str2 then
i:=1
else
i:=0;为什么我的结果总是i:=0呢?
varstr1,str2:string;
i:integer;......str1:='土木工程';
str2:='土木工程';if str1=str2 then
i:=1
else
i:=0;为什么我的结果总是i:=0呢?
解决方案 »
- RMB请人写注册表权限操作程序,价格好说,具体面议
- inno setup [code] 段问题
- TPageControl
- 如何通过DELPHI与WINDOWS系统中的按钮和文本框连接
- jpg图片没法在image控件中加载,显示jpeg error #52,请问是什么原因
- 输入的不是大写字母和数字的就提示输入错误,该怎么写?
- 谁有权限管理源码。
- 一个PAS文件,如果我直接放在工程文件的路径下面,并在别的单元中USES,可以运行,但是。。。。
- 使用ADOQUERY检索数据时,发生存储器不足提示,我的CODE真的那么占内存吗?
- delphi 直接上传文件到网盘,求指教
- DELPHI调用存储过程
- 怎样把一个字符串分割成字符串数组?
i:integer;......str1:='土木工程';
str2:='土木工程';if SameText(str1,str2) then
i:=1
else
i:=0;
i:integer;......str1:='土木工程';
str2:='土木工程';if str1=str2 then
showmessage('I=1');
else
showmessage('I<>1');这样去试试
同时说明=和SameText的区别:这两种都是比较使用的,=比较是大小写敏感比较,而SameText是大小写不敏感比较,楼主根据自己的需要选择了。
要不把其他代码贴出来,Look、Look
if trim(str1)=trim(str2)
又应该怎么比较呢?
i:integer; ...... str1:='土木工程';
str2:='土木工程'; if trim(str1)=trim(str2) then
i:=1
else
i:=0;
i:integer; ...... str1:='土木工程';
str2:='土木工程'; if str1=str2 then
begin
i:=1 ;
end;
else
begin
i:=0;
end;