如何打破c#中下一行的单个文本 [英] how to break single text in next line in c#

查看:54
本文介绍了如何打破c#中下一行的单个文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用sql数据读取器从数据库中检索了一些文本,并将其分配给了asp:label

例如,我使用datareader从数据库中检索了日期时间并将其分配给标签



现在Label.Text = sqlread [DATETIME];



label.text显示日期时间为2014年2月14日上午11:00:00
现在我想要一行中的
休息时间并在下一行显示它请告诉我如何实现这一点。

解决方案

试试这个

  string  ss =   2014年2月14日11: 00:00 am; 
string [] array = ss.Split(' ');
string outp = array [ 0 ] + < / BR> + array [ 1 ] + array [ 2 ];


i have retrieved some text from database using sql data reader and assigned it to the asp:label
e.g i have retrieved date time from database using datareader and assigned it to label

now Label.Text= sqlread["DATETIME"];

label.text displays date time as 14/02/2014 11:00:00 a.m.
in a single line now i want to break time and display it in next line pls tell me how to achieve this.

解决方案

Try this

string ss = "14/02/2014 11:00:00 a.m.";
       string[] array = ss.Split(' ');
       string outp  =  array[0] + "</BR>" + array[1] + array[2];


这篇关于如何打破c#中下一行的单个文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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