Delphi:如何在ini文件中使用换行符? [英] Delphi: How to use line breaks in a ini file?

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

问题描述

使用Delphi在ini文件中是否可以有换行符?

Is it possible to have line breaks in an ini file using Delphi?

我有一个想要使用的字符串值,但是它需要具有换行的能力。我不需要其他格式的文本。

I have a string value that I'd like to use, but it needs to have the ability for line breaks. I don't need any other formatting of the text.

我该怎么做?

推荐答案

自从我进行Delphi以来已经有一段时间了,但是我认为您不能直接包含换行符-一行是一行

It's been a while since I did Delp but I think you can't directly include linefeeds - a line is a line.

但是正如Örjan所说,您可以在字符串中包含可以由程序解释为换行符的字符。

But as Örjan says, you can include characters in your string that can be interpreted by your program as line breaks.

我怀疑.ini文件中是否会以任何方式自动对 automaticallyn进行特殊处理,但是您可能会包含其他一些很少使用的字符,例如管道(|)或代字号(〜),然后让您的应用将其转换为换行符。

I doubt that "\n" is automatically treated specially in any way in a .ini file, but you could include some other rarely used character, such as the pipe (|) or tilde (~) and just let your app translate that to a line break.

这篇关于Delphi:如何在ini文件中使用换行符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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