-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Chakravarthy
Message 2 in Discussion

Hey your problem doesn't have the following information. 1) Which database that 
you are using? 2) When do you want to store the values in to 2nd table? In 
other words, at which event that you want to slice the data from the first 
table and storing the data in the second table. 3) I assume you are using C# 
and you want to store the data into the second table and prepared some piece of 
code which on invoke will split the given string into what ever you want.  
/// <summary> 
/// This is the main Function which will be used to split the Source string 
/// </summary> 
/// <param name="Source"></param> 
/// <param name="EvenOdd">True for Even and False for Odd</param> 
/// <returns></returns> 
string AltString(string Source, bool EvenOdd) 
{ 
StringBuilder sbVal = new StringBuilder(); 
for(int intPosi = EvenOdd?0:1 ; intPosi<Source.Length;) 
{ 
sbVal.Append(RetCharAtPosi(Source,intPosi)); 
intPosi +=2; 
} 
return sbVal.ToString(); 
} 
/// <summary> 
/// This is a sub method which will return the char of the given position 
/// </summary> 
/// <param name="strSource">Source String from the calling function</param> 
/// <param name="intPosi"> Which position, ex: 5th Letter in Chakravarthy is 
"r" </param> 
/// <returns></returns> 
char RetCharAtPosi(string strSource, int intPosi) 
{ 
char[] cRetVal = strSource.Substring(intPosi,1).ToCharArray(); 
return cRetVal[0]; 
} 
You can call these functions as  
string strOdd = AltString("Chakravarthy",false); 
string strEve = AltString("Chakravarthy",true); What do you say?

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to