Vector{String} is semantically equivalent to Array{String, 1}. It's just more 
readable.

Also worth noting that you basically never want to work with Vector{String}. 
You almost certainly want Vector{UTF8String}.

 -- John

On Jul 24, 2014, at 7:47 PM, cnbiz850 <[email protected]> wrote:

> Thanks.  Didn't know about that syntax.  Now with it, I might prefer the 
> following as Array{String,1} is exactly what I want.
> 
> julia> dts1 = convert(Array{String,1},dt)
> 3-element Array{String,1}:
> "2010/1/4T15:00:00"
> "2010/1/5T15:00:00"
> "2010/1/6T15:00:00"
> 
> 
> On 2014年07月25日 10:40, Miles Lubin wrote:
>> How about "convert(Vector{String},dt)"?
>> 
>> On Thursday, July 24, 2014 8:39:02 PM UTC-6, K leo wrote:
>> 
>>    I have an Array{Any,1}, but I want to convert to Array{String,1}. The
>>    only way I know is through comprehension.
>> 
>>    julia> dt
>>    3-element Array{Any,1}:
>>      "2010/1/4T15:00:00"
>>      "2010/1/5T15:00:00"
>>      "2010/1/6T15:00:00"
>> 
>> 
>>    julia> dts = [convert(String, dt[i]) for i=1:length(dt)]
>>    3-element Array{String,1}:
>>      "2010/1/4T15:00:00"
>>      "2010/1/5T15:00:00"
>>      "2010/1/6T15:00:00"
>> 
> 

Reply via email to