12-12-2011删除-从这种形式的需要起12122011 [英] 12-12-2011 remove - from date need in such formate 12122011

查看:67
本文介绍了12-12-2011删除-从这种形式的需要起12122011的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


2011年12月12日删除-从asp.net中这样的格式12122011中的需要起算


12-12-2011 remove - from date need in such formate 12122011 in asp.net

推荐答案

请拆分并显示所需的格式.
和其他格式
获取日期表格sqlserver

please split and show required format.
and other format
get date form sqlserver

SELECT convert(varchar, getdate(), 112)
result come this type 
20120229



另请参阅此链接
http://anubhavg.wordpress.com /2009/06/11/how-to-format-datetime-date-in-sql-server-2005/ [



also see this link
http://anubhavg.wordpress.com/2009/06/11/how-to-format-datetime-date-in-sql-server-2005/[^]


返回替换
的日期
Return date from Replace
<br />
DateString = DateString.Text.Replace("-", "")<br />



您可以尝试在单个函数中替换多个字符



you can try this to replace multiple characters in single function

<br />
string val = System.Text.RegularExpressions.Regex.replace(val, @"[-_]", ""); <br />


在C#中,您可以使用Replace()方法,
In C# you can use Replace() method,
string dt="here goes your date expressin";
dt.Replace("-","");


这样,您可以使用Replace()函数解决您的问题.
希望对您有帮助..


in this way u can resolve ur problem using Replace() function.
hope this will help you..


这篇关于12-12-2011删除-从这种形式的需要起12122011的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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