Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21090

String to double array

$
0
0
I have a string of csv values. I want to get a double array from the string. If I split the string on comma I get an array of strings. can i convert the string array to a double array easily?

For example the variable I have is:

txt_string="12,13,14,15"
I tried CDbl(Split(txt_string,",")) but VB does not like that syntax.

My only thought now is to convert to a temp string then loop through the string to set to double values.
Something like this:
txt_string="12,13,14,15"
tmp_stringarray = Split((txt_string,",")
for i = 0 to Ubound(tmp_stringarray)
dbl_array(i) = CDbl(tmtp_stringarray(i)
next i

Viewing all articles
Browse latest Browse all 21090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>