# Problem with split.(...)

**URL:** <https://discourse.julialang.org/t/problem-with-split/9118>\
**Category:** General Usage\
**Created:** [February 16, 2018, 7:08pm UTC](https://discourse.julialang.org/t/problem-with-split/9118 "2018-02-16T19:08:32Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [February 16, 2018, 7:13pm UTC](https://discourse.julialang.org/t/problem-with-split/9118/2 "2018-02-16T19:13:36Z")

</div>

This is actually exactly the same problem as [Vectorization and passing a matrix as an argument - #2 by rdeits](https://discourse.julialang.org/t/vectorization-and-passing-a-matrix-as-an-argument/9114/2) from earlier today. If you want each element in `P` to receive the entire vector `['{', '}']`, then you can wrap that vector in a one-element tuple (to “scalarize” it):

```julia
julia> P = ["{foo", "bar}", "baz}"]
3-element Array{String,1}:
 "{foo"
 "bar}"
 "baz}"

julia> strip.(P, ['{', '}'])
ERROR: DimensionMismatch("arrays could not be broadcast to a common size")
Stacktrace:
 [1] _bcs1(::Base.OneTo{Int64}, ::Base.OneTo{Int64}) at ./broadcast.jl:70
 [2] _bcs at ./broadcast.jl:63 [inlined]
 [3] broadcast_shape at ./broadcast.jl:57 [inlined] (repeats 2 times)
 [4] broadcast_indices at ./broadcast.jl:53 [inlined]
 [5] broadcast_c at ./broadcast.jl:313 [inlined]
 [6] broadcast(::Function, ::Array{String,1}, ::Array{Char,1}) at ./broadcast.jl:455

julia> strip.(P, (['{', '}'],))
3-element Array{String,1}:
 "foo"
 "bar"
 "baz"

```

Also, please quote your code: [PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530)

---

_[View the full topic](https://discourse.julialang.org/t/problem-with-split/9118)._
