在Delphi中使用字符串中的引用 [英] Using quote inside strings in Delphi

查看:121
本文介绍了在Delphi中使用字符串中的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

如何在Delphi字符串中转义字符

在Delphi中,一个字符串包含在一对'中,但我需要在我的字符串中使用' ...
,当我使用它结束整个字符串标识。

In Delphi a string is contained within a pair of ' but I need to use ' in my string... and when I use one it brings a end to the entire string identification.

'inside string ' but this bit is outside' inside again' and the end

是否有一些符号可以消除编码影响的下一个字符?

Is there some symbol that removes the coding affect of the next character?

推荐答案

您需要另一个报价来转义报价:

You need another quote to escape a quote:

Writeln('I''m in your head'); //prints: I'm in your head
Writeln(''''); //prints: '

另请参见这个问题

这篇关于在Delphi中使用字符串中的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆