Geeks With Blogs

News


Rodney Vinyard - .NET & SQL Developer When all is said and done, more will be said than done
String.Split Method
 

Public Class StringSplit2
  
   Public Shared Sub Main()
     
      Dim delimStr As String = " ,.:"
      Dim delimiter As Char() = delimStr.ToCharArray()
      Dim words As String = "one two,three:four."
      Dim split As String() = Nothing
     
      Console.WriteLine("The delimiters are -{0}-", delimStr)
      Dim x As Integer
      For x = 1 To 5
         split = words.Split(delimiter, x)
         Console.WriteLine(ControlChars.Cr + "count = {0,2} ..............", x)
         Dim s As String
         For Each s In  split
            Console.WriteLine("-{0}-", s)
         Next s
      Next x
   End Sub 'Main
End Class 'StringSplit2

[C#]
using System;

public class StringSplit2 {
    public static void Main() {

        string delimStr = " ,.:";
    char [] delimiter = delimStr.ToCharArray();
        string words = "one two,three:four.";
        string [] split = null;

    Console.WriteLine("The delimiters are -{0}-", delimStr);
    for (int x = 1; x <= 5; x++) {
        split = words.Split(delimiter, x);
            Console.WriteLine("\ncount = {0,2} ..............", x);
        foreach (string s in split) {
                Console.WriteLine("-{0}-", s);
              }
    }
    }
}

 

Posted on Tuesday, December 8, 2009 9:27 AM miscellaneous | Back to top


Comments on this post: String.Split Method

# re: String.Split Method
Requesting Gravatar...
I think I am not good enough for this soft. I can not understand it.
wedding dresses
Left by GG on Mar 29, 2010 12:17 AM

# re: String.Split Method
Requesting Gravatar...
Very good work! I always like to leave comments whenever I see something unusual or impressive. thnks
Left by geo tv on Jul 22, 2010 12:37 PM

# re: String.Split Method
Requesting Gravatar...
Nice post.Thank you for taking the time to publish this information very useful!
I’m still waiting for some interesting thoughts from your side in your next post thanks
Left by repilca nfl jerseys on Aug 02, 2010 9:31 PM

# re: String.Split Method
Requesting Gravatar...
respaldo MBT zapatos saludables de gran alcance en el extranjero, tales como Madonna, el gobernador de California Arnold Schwarzenegger de estas celebridades están usando, y tomó la delantera frente a la tendencia de MBT zapatos es Faye Wong y Chao Chao Ma Ma Ying Hao Xu. La investigación científica muestra que el uso de los MBT no logrará general puede desempeñar un papel más importante de la fuerza muscular, con un tiempo fijo cada día puede mejorar la circulación sanguínea, reducir la velocidad debido a la mano de obra a largo bloque de los efectos causados por el dolor de espalda, así que por ahora los que son difícil encontrar tiempo para hacer ejercicio eran bienvenidos.

Left by chydream on Oct 03, 2010 3:14 AM

# re: String.Split Method
Requesting Gravatar...
I've bookmarked your blog, the articles are way better than other similar blogs.. thanks for a great blog!
Left by Nike SB Dunk on Nov 03, 2010 12:47 AM

# re: String.Split Method
Requesting Gravatar...
piao xian de xiao chi dian .e le ..
Left by cheap ugg boots on Nov 12, 2010 2:20 AM

# re: String.Split Method
Requesting Gravatar...
We have thousands of New Era Hats,dc shoes hats,Red Bull Hats,New Era Caps,NFL Hats And Famous Hats at cheap price for Wholesale
Left by DC Shoes Hats on Nov 12, 2010 8:16 AM

# re: String.Split Method
Requesting Gravatar...
thanks for the wondeful post free comic books
Left by free online books on Nov 22, 2010 12:53 PM

# re: String.Split Method
Requesting Gravatar...
thanks for your sharing!Best whishes!
Left by camcorders on Dec 01, 2010 1:15 AM

# re: String.Split Method
Requesting Gravatar...
Thank you for sharing this code and thank you for taking the time to post this very useful information!
Left by alloy wheels with tyres on Dec 09, 2010 3:32 AM

# re: String.Split Method
Requesting Gravatar...
There may be another way to do it.
Left by electronics on Dec 17, 2010 3:21 AM

# re: String.Split Method
Requesting Gravatar...
Just looking a sec on the code made me feel sick. I think I am not good enough for this soft. too hard for me.
Left by Curtis Johnson Realty on Jan 18, 2011 9:07 PM

# re: String.Split Method
Requesting Gravatar...
wonderful article
Left by free Wine books on Mar 21, 2011 9:44 AM

# re: String.Split Method
Requesting Gravatar...
you get the picture.
Left by event management company on May 23, 2011 4:11 AM

# re: String.Split Method
Requesting Gravatar...
Really good article, many thanks.
Left by wall art on May 25, 2011 6:09 AM

# re: String.Split Method
Requesting Gravatar...
though you have worked on it,I can't really understand it in fact.Sorry.because I'm not good at it.
Left by 7 stars handbags on Jun 22, 2011 8:46 PM

# re: String.Split Method
Requesting Gravatar...
Thanks a lot for sharing this with us, was a really great post and very interesting.
Left by floral canvas art on Jul 11, 2011 7:06 AM

# re: String.Split Method
Requesting Gravatar...
I recently came accross your blog and have been reading along. I thought I would leave my comment. I dont know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often. I would like to share with clients and my colleagues, and this article is certainly worth sharing!
Left by songfang on Aug 26, 2011 4:45 AM

# re: String.Split Method
Requesting Gravatar...
Good Post !
Thanks for your sharing.
Left by Lithium-ion Battery on Nov 15, 2011 6:25 AM

Your comment:
 (will show your gravatar)


Copyright © Rodney Vinyard | Powered by: GeeksWithBlogs.net