How can I split a string in VB.NET?
150641
ok, to split a string\n\nuse this code\n\ndim s1 as string = ("dog")\n\n Const d As Char = "d"c\n Const o As Char = "o"c\n Const g As Char = "g"c\n        Dim delimiters() As Char = {d, o, g}\n        Dim resultArray As String() = s1.Split(delimiters)\n\nFor Each substring In resultArray\n            ctr = ctr + 1\n            output &= ctr.ToString()\n            output &= ": "\n            output &= substring\n            output &= Environment.NewLine\n        Next substring\n        Console.WriteLine(output)\n\nhope that sorts that out\n\nR3dm0
865202
Dim s as String\n\n'assuming s is not nothing\ns = IIF(s.length() > 30, s.substring(0, 30), s)
244607
reverse( NewString.begin(), NewString.end() );\n\n(You will have to #include <algorithm> )
434435
It may be easier to use an array list.\n\n  Dim al As New ArrayList()\n\n   al.Add("This")\n   al.Add("Is")\n   al.Add("My")\n   al.Add("New")\n   al.Add("ArrayList")\n   al.Add("Control")\n\n   Console.WriteLine("Before Sort:")\n   WriteElements(al)\n\n   al.Sort()\n\n   Console.WriteLine("After Sort:")\n   WriteElements(al)\n End Sub\n\n Private Sub WriteElements(ByVal al As ArrayList)\n   Dim i As Integer\n   \n   For i = 0 To al.Count - 1\n     Console.WriteLine(CStr(al.Item(i)))\n   Next
500457
Dim objNet\non error resume next\n\nset objNet = CreateObject("WScript.Network")\n\nDim strInfo\nstrInfo = objNet.UserName &", "&objNet.ComputerName&", "&objNet.DomainName
810330
I am not a .Net person yet, but with VB6 this would work, I think :\n\nwith dgrdTest\n.row = 3 (+1 if there is a header row)\n.column = number of name column\n\ndebug.print .text\nend with\n\nNot sure if that will help with .net or if it even functions the same way.\n\nHere is a link to vb.net datagrid how-to : http://www.vb-helper.com/howto_net_datagrid.html.\n\nGoogle it : http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=GGLG,GGLG:2006-18,GGLG:en&q=vb%2enet+datagrid\n\nEnjoy!
926631
use the function 'toCharArray()'\n\nexample:\nString name = "mary";\nchar[]nameByte = name.toCharArray();
1045597
you must get current value of row spli it with ', ' and insert 2 section or more of rows another time to table .therefore need to 3 functon :\nget - split - update(or insert)
220856
Try winrar and execute the command WIZARD in Tools menu... and specify the blocj's size in which the want to split your file.
357526
This question is pretty vague. If you're serious about getting a good answer you have to make it more specific. VB6 or VB.Net? Web Forms or Win Forms?\n\nIf it's VB6 then you simply write the code to do what you need it to do. You want to validate user input immediately after the form has been submitted for processing. \n\nIf it's VB.Net then you can use the Validator controls. The method is different based on whether it's a web from or a windows form. \n\nHere are some .Net tutorials:\n\nhttp://samples.gotdotnet.com/quickstart/aspplus/doc/webvalidation.aspx\n\nhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconValidationOfControlDataOnWindowsForms.asp\n\n\n\ngood luck
91807
Easy! Now since you didn't specify a language, I'll give you a sample of 3 languages.\n\nHere it is in Java:\n...\nString s = "Some string here";\nString subString = s.substring(2,9);\n...\nIn Delphi:\n...\nvar s, subString:String;\nbegin\n...\ns = "Some string here";\nsubString := MidStr(s,3,10);\n\nIn VB: \ndim s, subString as String\ns = "Some string here"\nsubString = Mid(s,3,10)\n\nIf you need any more help, don't hesitate to e-mail me on nate AT tsamail.co.za.
210144
Make sure you call the Read() method on your reader before you attempt to assign its values to your label.\n\nDim objConn As New SqlConnection(connString)\nDim objCmd As New SqlCommand("spMyProcedure", objConn)\nobjCmd.CommandType = CommandType.StoredProcedure\nDim objReader As new SqlDataReader\n\nobjConn.Open()\nobjReader = objCmd.ExecuteReader()\nobjReader.Read()\nlabel1.Text - objReader("columnname")\nobjConn.Close()\n\nobjCmd.Dispose()\nobjConn.Dispose()
392646
You usually do this by using a programming language and comparing the input to a regular expression.\n\nLook up "regular expression tutorial" in Yahoo search and you'll find more information that you probably want  :)
75210
I'm assuming the data is in ONE table, with columns X, Y respectively, with Y having data that is comma delimited.  If so, then:\n\n1) Create a function that splits delimited data into multiple rows:\n\nCREATE FUNCTION fnUtil_Split(@SplitString varchar(8000), @Delimiter varchar(10))\n-- This function simulates the VB split function and returns a table containing all\n-- of the split values.\n-- Code obtained from http://www.odetocode.com/Code/58.aspx\n\nRETURNS @SplitTable TABLE(\n TableVar  varchar(500)\n   )\nAS\nBEGIN\n-- Helper variables\nDECLARE @FC int\nSET @FC = -1\n\n-- Loop until there is no more\nWHILE (Len(@SplitString) > 0) BEGIN\nSET @FC = CHARINDEX(@Delimiter , @SplitString)\n\nIF (@FC = 0) AND (LEN(@SplitString) > 0) BEGIN\nINSERT INTO @SplitTable VALUES (RTRIM(LTRIM(@SplitString)))\nBREAK\nEND\n\nIF (@FC > 1) BEGIN\nINSERT INTO @SplitTable VALUES (RTRIM(LTRIM(LEFT(@SplitString, @FC - 1))))\nSET @SplitString = RTRIM(LTRIM(RIGHT(@SplitString, (LEN(@SplitString) - @FC))))\nEND ELSE SET @SplitString = RTRIM(LTRIM(RIGHT(@SplitString, (LEN(@SplitString) - @FC))))\nEND\n\nRETURN\nEND\n\n2)  Cross join to combine the delimited data of column Y with the data in column X:\n\nSELECT mytable.X, split_table.delimitedData\nFROM mytable \n       cross join (SELECT TableVar AS delimitedData\n                   FROM dbo.fnUtil_Split(mytable.Y, ',')\n                  )AS split_table\n\nThis should combine column X with the "split" data from column Y.
902027
I have used VB for years and as far as I know, it doesnt have dynamic arrays. VB was not designed to be used like that so it probably doesnt have a syntax for it.
197427
Sub Main()\n        Console.WriteLine(2 ^ 5)\n        Console.ReadLine()\nEnd Sub
425992
Put the following code in any sub u want:\n Dim i As Integer\n        For i = 1 To 100\n            If i Mod 2 = 1 Then\n                ListBox1.Items.Add(i)\n            End If\n        Next\n\nI retrieved all the values in a list box , u can retrieve it by any way u want, Hope this Helps :)