lothos12345 Posted July 5, 2005 Posted July 5, 2005 What is the correct syntax to split a string in VB.NET with option strict on? Any help given is greatly appreciated. Quote
a_jam_sandwich Posted July 5, 2005 Posted July 5, 2005 Dim MyString() As String MyString = Split("this is a string to split", " ") Regards Andy Quote Code today gone tomorrow!
patrick24601 Posted July 5, 2005 Posted July 5, 2005 For the future... this is and most language syntax can be looked up for free at MSDN.com. Please find it and bookmark it. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemStringClassSplitTopic.asp The only thing special I can think of is that your delimiter may have to sub appended with a c ( as in string.split(mybigstring,'F'c) to make the method happy. It is expecting a character and by default I think 'F' is assumed to be a string. Quote
Administrators PlausiblyDamp Posted July 5, 2005 Administrators Posted July 5, 2005 Or Dim MyString() As String Dim s As String = "this is a string to split" MyString = s.Split(" ") if you prefer to use the .Net methods rather than the legacy VB functions. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.