tag:blogger.com,1999:blog-5199087724247829980.post7721887831940741499..comments2023-05-30T12:47:39.613-07:00Comments on asp.net interview questions: Reusable SQL function to split a stringUnknownnoreply@blogger.comBlogger5125tag:blogger.com,1999:blog-5199087724247829980.post-43927110672465258382017-02-16T04:11:58.906-08:002017-02-16T04:11:58.906-08:00using System;
using System.Text;
namespace Generic...using System;<br />using System.Text;<br />namespace GenericsSample<br />{<br />class Program<br />{<br />static void Main()<br />{<br />string strOriginalString = "Token A^*!%~Token B^*!%~Token C^*!%~Token D^*!%~Token E";<br />string[] strSeperator = new string[1];<br />strSeperator[0] = "^*!%~";<br /><br />string[] strArrayIndividualStrings = strOriginalString.Split(strSeperator, StringSplitOptions.RemoveEmptyEntries);<br /><br />int intLengthOfStringArray = strArrayIndividualStrings.Length;<br /><br />StringBuilder sbOutputString = new StringBuilder();<br />for (int i = (intLengthOfStringArray - 1); i >= 0; i--)<br />{<br />sbOutputString.Append(strArrayIndividualStrings[i] + strSeperator[0]);<br />}<br />Console.WriteLine("Original String : " + strOriginalString);<br />Console.WriteLine("Output String : " + sbOutputString.ToString());<br />Console.ReadLine();<br />}<br />}<br />}Anonymoushttps://www.blogger.com/profile/05490811043750666956noreply@blogger.comtag:blogger.com,1999:blog-5199087724247829980.post-84963120338504546342016-07-08T00:15:44.540-07:002016-07-08T00:15:44.540-07:00Please write a sample program that parses the stri...Please write a sample program that parses the string into a series of substrings where the delimiter between the substrings is ^*!%~ and then reassembles the strings and delimiters into a single new string where each of the substrings is in the reverse order from the original string. The method must return the final string.<br /><br />Original String <br />Token A^*!%~Token B^*!%~Token C^*!%~Token D^*!%~Token E<br /><br />Output String<br />Token E^*!%~Token D^*!%~Token C^*!%~Token B^*!%~Token AAnonymoushttps://www.blogger.com/profile/02728538870855606403noreply@blogger.comtag:blogger.com,1999:blog-5199087724247829980.post-67743350488143839902013-05-04T09:30:53.497-07:002013-05-04T09:30:53.497-07:00In C#, this is the code.
string s = "123|456...In C#, this is the code.<br /><br />string s = "123|456|234|435";<br /><br />string[] star = s.Split('|');<br />foreach (string word in star)<br />{<br /> Response.Write(word+"<br>");<br />}Anonymoushttps://www.blogger.com/profile/14570051572059092633noreply@blogger.comtag:blogger.com,1999:blog-5199087724247829980.post-66809977449423993102012-03-15T05:18:45.909-07:002012-03-15T05:18:45.909-07:00In c# you can just use string.split('|') m...In c# you can just use string.split('|') method...that will give you string array back with all the split membersAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5199087724247829980.post-40546793391864215412011-11-08T04:25:18.932-08:002011-11-08T04:25:18.932-08:00pls write it in C#pls write it in C#kishorehttps://www.blogger.com/profile/02521738626922598497noreply@blogger.com