开发者

Adding new lines to Alert text

开发者 https://www.devze.com 2022-12-24 22:22 出处:网络
I want to crea开发者_开发百科te a simple multiline Alert popup Alert.show(\"Blah\\\\nBlah\") shows Blah\\nBlah when what I really want is two lines, one Blah each.If it is anything like most langua

I want to crea开发者_开发百科te a simple multiline Alert popup

Alert.show("Blah\\nBlah")

shows Blah\nBlah when what I really want is two lines, one Blah each.


If it is anything like most languages, then you only need to have \n to get a new line. having \\n is saying that you actually do want to draw a \ because normally the back slash is used to say you're about to do some thing special.


Try:

Alert.show("Blah\nBlah")
0

精彩评论

暂无评论...
验证码 换一张
取 消