What do you actually want to do? Extract all characters after a comma?

On Thursday, October 20, 2016 at 9:26:01 PM UTC+2, programistawpf wrote:
>
> Ok, I finded: findin(temp,[","])...
>
> for i=1:nol
> temp=(collect(graphemes(readline(o))))
> poz=(findin(temp,[","])[end])+1
> write(io, temp[poz])
> write(io, "\n")
> if mod(i,10^6)==0 println(i) end
> end
>
> But is very slow :/ someting faster ? I have 10^ 8 line of tekst :/
>
> Paul
>
>
> W dniu 2016-10-20 20:28, program...@gmail.com <javascript:> pisze: 
>
> Thx, i slower but works:) and next question : ho to find Char in 
> collection ?
> julia> str="abc"
> "abc"
>
> julia> findin(str,"c")
> 1-element Array{Int64,1}:
>  3
>
> julia>
>
> julia> temp=collect(graphemes(str))
> 3-element Array{SubString{String},1}:
>  "a"
>  "b"
>  "c"
>
> julia> findin(temp,"c")
> 0-element Array{Int64,1}
>
> julia> findin(temp,'c')
> 0-element Array{Int64,1}
>
> julia> find(temp,'c')
> ERROR: MethodError: no method matching find(::Array{SubString{String},1}, 
> ::Char)
> Closest candidates are:
>   find(::Function, ::Any) at array.jl:1082
>   find(::Any) at array.jl:1116
>
> W dniu czwartek, 20 października 2016 20:06:26 UTC+2 użytkownik Ismael 
> Venegas Castelló napisał: 
>>
>> You can use collect(graphemes(s))[3], for example, see also this SO 
>> question and it's answers: 
>>
>>
>> http://stackoverflow.com/questions/39501900/truncate-string-in-julia/39505998#39505998
>>
>
>

Reply via email to