惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
量子位
M
MIT News - Artificial intelligence
Y
Y Combinator Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
雷峰网
雷峰网
I
InfoQ
罗磊的独立博客
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
博客园 - 三生石上(FineUI控件)
The GitHub Blog
The GitHub Blog
K
Kaspersky official blog
P
Privacy & Cybersecurity Law Blog
S
SegmentFault 最新的问题
T
Threat Research - Cisco Blogs
H
Help Net Security
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CERT Recently Published Vulnerability Notes
WordPress大学
WordPress大学
T
Tenable Blog
T
The Blog of Author Tim Ferriss
C
Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - Franky
A
Arctic Wolf
T
Threatpost
Scott Helme
Scott Helme
C
Cybersecurity and Infrastructure Security Agency CISA
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
The Exploit Database - CXSecurity.com
G
GRAHAM CLULEY
Security Latest
Security Latest
Spread Privacy
Spread Privacy
L
LINUX DO - 热门话题
V
Vulnerabilities – Threatpost
P
Privacy International News Feed
S
Schneier on Security
Latest news
Latest news
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com

博客园 - levin

如何读取内存的数据?(转) ECC 6.0 安装之后的配置(转) 网络分析中数据包结构的定义 网络管理之数据包的解释与结构分析(转) SAP BDC 技术的分类(转) Delphi中建议使用的语句 Delphi面向对象编程的20条规则 Delphi取整函数 ECC 6.0 New GL Functionality and General FAQ - levin Delphi中的容器类 BDC教程(转) - levin - 博客园 SAP BDC批量导入数据(转) - levin - 博客园 Master data-Customer 如何快速从BSEG读取数据(转) Rules for Better SQL Programming 刷新ALV定位到当前记录行 - levin - 博客园 双击ALV调用事务代码并传入参数 如何查找系统屏幕参数 一些常用的系统变量(SYST) ABAP内表(internal table)有关的系统变量
ABAP字符串比较操作中空格的影响
levin · 2009-08-03 · via 博客园 - levin

ABAP对字符串有很多隐形的操作,有时更方便程序员,有时又比较容易使人困惑。

比如在比较字符串的值时,ABAP会自动忽视有效字符后面的空格,而如果在字符前面有空格,则会影响比较的结果。

比如: ‘X’ 和 ‘X__’ 比较的结果是相等;而’X'和’__X’比较的结果则是不相等。 (这里下划线__代表空格)

运行下面的程序可以看到效果:

DATA: l_string1 TYPE string,
l_string2 TYPE string,
l_string3 TYPE string.
l_string1 = ‘X’. “No space
l_string2 = ‘X ‘. “Space after X
l_string3 = ‘ X’. “Space before X
IF l_string1 EQ l_string2.
WRITE: / ‘String 1 and String 2 are identical.’.
ELSE.
WRITE: / ‘String 1 and String 2 are NOT identical.’.
ENDIF.
IF l_string1 EQ l_string3.
WRITE: / ‘String 1 and String 3 are identical.’.
ELSE.
WRITE: / ‘String 1 and String 3 are NOT identical.’.
ENDIF.

运行结果是输出:

String 1 and String 2 are identical.

String 1 and String 3 are NOT identical.