Thank you for the suggestion. I tried to use parseint on the Char array and 
got the following error:

`parseint` has no method matching parseint(::Array{Char,1})


On Monday, June 15, 2015 at 1:02:21 PM UTC-4, Huda Nassar wrote:
>
> You can use the parseint function:
>
> *julia> **a = '3'*
>
> *'3'*
>
> *julia> **typeof(a)*
>
> *Char*
>
> *julia> **b = parseint(a)*
>
> *3*
>
> *julia> **typeof(b)*
>
> *Int64*
>
>
>
> On Monday, June 15, 2015 at 12:39:14 PM UTC-4, James Byars wrote:
>>
>> Hey all,
>>
>> I am working through some Project Euler problem (#008) about searching 
>> through a number to determine the greatest product of 
>> thirteen adjacent numbers. Here is a code snippet:
>>
>> n = 12
>> numb_strg = "82166370484403199890008895243450658541227588666881"
>> string_post = length(numb_strg) - n
>> string_post = 0
>>
>> When I run this command: *collect(numb_strg[(string_post+1):(string_post*
>> *+n)])*
>>
>> I get a character vector.
>>
>> 12-element Array{Char,1}:
>>  '8'
>>  '2'
>>  '1'
>>  '6'
>>  '6'
>>  '3'
>>  '7'
>>  '0'
>>  '4'
>>  '8'
>>  '4'
>>  '4'
>>
>>
>> However, if I attempt to convert it to a integer array. I get the 
>> following array.
>>
>> 12-element Array{Int64,1}:
>>  56
>>  50
>>  49
>>  54
>>  54
>>  51
>>  55
>>  48
>>  52
>>  56
>>  52
>>  52
>>
>>
>> If I subtract 48 from the each element in the array, I get the correct 
>> number. Is there any reason for the odd conversion from character to integer 
>> (or float)? My primary language is R and I am using Project Euler to learn 
>> Julia.
>>
>>
>> Thanks,
>>
>>
>> James
>>
>>

Reply via email to