Improving the answer

f = Bool[contains("b",i) for i in A]

susch that

A[f]

returns 

 "aab" and "aba".

Hope it helps.

On Wednesday, July 8, 2015 at 2:58:43 PM UTC-3, Eduardo Lenz wrote:
>
> Hi
>
>    [contains("b",i) for i in A]
>
> should do the trick.
>
> On Wednesday, July 8, 2015 at 2:26:12 PM UTC-3, paul analyst wrote:
>>
>> Is array A
>> julia> A=["aaa","aab","aac","aba"]
>> 4-element Array{ASCIIString,1}:
>>  "aaa"
>>  "aab"
>>  "aac"
>>  "aba"
>>
>> How to How to find the index this arrary containing "b" ?
>>
>>
>> julia> find(A,"b")
>> ERROR: `find` has no method matching find(::Array{ASCIIString,1}, 
>> ::ASCIIString)
>>
>> julia> getindex(A,"b")
>> ERROR: `getindex` has no method matching getindex(::Array{ASCIIString,1}, 
>> ::ASCIIString)
>>
>> julia> search(A,"b")
>> ERROR: `search` has no method matching search(::Array{ASCIIString,1}, 
>> ::ASCIIString)
>>
>> julia> search(A,"b")
>> ERROR: `search` has no method matching search(::Array{ASCIIString,1}, 
>> ::ASCIIString)
>>
>>
>> Paul
>>
>

Reply via email to