C ++到C# [英] C++ to C#

查看:56
本文介绍了C ++到C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VC ++中,如果想要在线打破一个字符串我可以使用它

\ n"


C#中的等价物是什么?


TIA

解决方案

Vai2000写道:


在VC ++中,如果想要在线打破一个字符串我可以使用它

\ n"


C#中的等价物是什么?



相同。

-

Tom Porterfield


Vai2000写道:


在VC ++中如果想在线上打破一个字符串我可以使用这个

\ n"


C#中的等价物是什么?



System.Environment.NewLine。通常它的值为\\\\ n。


C#识别C字符转义\ r和\ n并且它们具有相同的

它们在C中的字符等价性。一般来说,C#不遵循单个\ n表示换行的C约定,并且输出

(例如,一个文件或控制台),.NET不会将\ n转换为\\\\ n,因为在Windows上运行时通常会执行此操作。


-cd




" Vai2000" < no **** @ microsoft.comwrote in message

news:uw ************** @ TK2MSFTNGP04.phx.gbl ...


在VC ++中,如果想在线上断字符,我可以使用这个

\ n"


C#中的等价物是什么?


TIA



试试Environment.NewLine


In VC++ if wanted to break a string on line I can use this
\n"

What''s the equivalent in C#?

TIA

解决方案

Vai2000 wrote:

In VC++ if wanted to break a string on line I can use this
\n"

What''s the equivalent in C#?

Same.
--
Tom Porterfield


Vai2000 wrote:

In VC++ if wanted to break a string on line I can use this
\n"

What''s the equivalent in C#?

System.Environment.NewLine. Typically this has the value \r\n.

C# recognizes the C character escapes \r and \n and they have the same
character equivalence that they have in C. C# in general does NOT follow
the C convention that a single \n indicates a line break, and on output
(e.g. to a file or to the console), .NET will NOT convert \n to \r\n as C
typically does when running on Windows.

-cd



"Vai2000" <no****@microsoft.comwrote in message
news:uw**************@TK2MSFTNGP04.phx.gbl...

In VC++ if wanted to break a string on line I can use this
\n"

What''s the equivalent in C#?

TIA

Try Environment.NewLine


这篇关于C ++到C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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