.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

perform split..

Posted By: gopal     Posted Date: August 05, 2009    Points:2   Category :ASP.Net
how to use split in asp.net..

and also i want to know how to use split in dataset values..
(FOR EXAMPLE IN DATASET I HAVE DATES . IN THAT DATE I WANT TO ADD ONLY MONTH IN DROPDOWNLIST)

i want some examples for split..
need ur suggestions..

regards
gopal.s

Responses
Author: Akhil Raj       [Moderator]      
Posted Date: August 05, 2009     Points: 5   

hi friend..you mean String.Split..

simply use the YourString.Split and pass the character to split as parameter.
eg:

String s = "Hi, How are You?"
Here i want to split "hi" and "how are you in 2 separate.

The Split returns the string array..So

String[] s1 = s.Split('',''); //so the string separated with '','' (comma) as the separate character.

So i got the 2 string like the following

String ans1 = s1[0];
String ans2 = s1[1];

I think you got the logic. So you can use this for the dates also. First check the separate character and pass as parameter.

If you have String s = "12/10/2009" (dd/mm/yyyy format)

Then you can got the month value from s.Split(''/'')[1]



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend