Jan 26, 2004 #1 C cdoverlaw Well-known member Joined Oct 11, 2003 Messages 146 how do i break the letters appart in a string as i am working on a soundex method to create a key for a surname
how do i break the letters appart in a string as i am working on a soundex method to create a key for a surname
Jan 26, 2004 #2 I iebidan Well-known member Joined Feb 6, 2003 Messages 484 substr will be helpful on that one
Jan 26, 2004 #3 S splice Well-known member Joined Jul 2, 2003 Messages 62 Location Boulder, CO use the Chars() member method of the String object
Jan 26, 2004 #4 dynamic_sysop Well-known member Joined Oct 1, 2002 Messages 1,039 Location Ashby, Leicestershire. you can break up the characters like this ... Code: Dim c As Char() = "some text".ToCharArray() /// the string some text is now broken up to individual characters.
you can break up the characters like this ... Code: Dim c As Char() = "some text".ToCharArray() /// the string some text is now broken up to individual characters.
Jan 26, 2004 #5 N NK2000 Well-known member Joined Jan 24, 2004 Messages 165 uhm splice was quite right, he only didnt see that Chars isnt a method but a property you can go through each char by string text = "blabla"; // for (int i = 0; i < text.Length; i++) { char c = text.Chars; ... } or foreach (char c in text.Chars) { ... } of course dynamic_sysops answer is also write but unnecessarily complicated, but i would never criticize a forum leader *duck* so many ways go to rome and you can use some different ways to get to your aim, just choose your style ( I prefer the for one at this situation )
uhm splice was quite right, he only didnt see that Chars isnt a method but a property you can go through each char by string text = "blabla"; // for (int i = 0; i < text.Length; i++) { char c = text.Chars; ... } or foreach (char c in text.Chars) { ... } of course dynamic_sysops answer is also write but unnecessarily complicated, but i would never criticize a forum leader *duck* so many ways go to rome and you can use some different ways to get to your aim, just choose your style ( I prefer the for one at this situation )
Jan 26, 2004 #6 dynamic_sysop Well-known member Joined Oct 1, 2002 Messages 1,039 Location Ashby, Leicestershire. lol , btw its not complicated :-\ Code: Dim s As String = "some text" Dim c As Char For Each c In s.ToCharArray Console.WriteLine(c.ToString) Next
lol , btw its not complicated :-\ Code: Dim s As String = "some text" Dim c As Char For Each c In s.ToCharArray Console.WriteLine(c.ToString) Next