hello,
I have developed some code below to split a string.
In a string I get back from a database i have for example "13 Hours". I have to split this and put them into 2 different string variables. So it would separate 13 from hours.
Does anyone know of any better method to do this.
Many thanks,
Code:'Split the estimated duration into value and periodically (dates) i.e. "4 Days" to "4" "Days" Dim duration As String = Me.DsIncidentsControl.IncidentTask(0).EstimatedDuration Dim strArray(2) As String 'Array with 2 element to hold the number and date strArray = duration.Split(" ") 'Split at the space Me.txtEstimatedDuration.Text = strArray(0) 'Assign the number value Me.cboDuration.Text = strArray(1) 'Assign the date




Reply With Quote