From 6efa68b4eff7457be3ea2c9b54eca0d860189859 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Wed, 28 Mar 2018 14:18:55 -0700 Subject: [PATCH] Try to clarify `split` docs (#26634) The description of the options was confusing. --- base/strings/util.jl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/base/strings/util.jl b/base/strings/util.jl index 81d838b665f1c..613d9767eb92d 100644 --- a/base/strings/util.jl +++ b/base/strings/util.jl @@ -239,17 +239,20 @@ function rpad( end """ - split(s::AbstractString, [chars]; limit::Integer=0, keep::Bool=true) + split(s::AbstractString; limit::Integer=0, keep::Bool=false) + split(s::AbstractString, chars; limit::Integer=0, keep::Bool=true) Return an array of substrings by splitting the given string on occurrences of the given character delimiters, which may be specified in any of the formats allowed by [`findnext`](@ref)'s first argument (i.e. as a string, regular expression or a function), or as a single character or collection of characters. -If `chars` is omitted, it defaults to the set of all space characters, and -`keep` is taken to be `false`. The two keyword arguments are optional: they are a -maximum size for the result and a flag determining whether empty fields should be kept in -the result. +If `chars` is omitted, it defaults to the set of all space characters. + +The optional keyword arguments are: + - `limit`: the maximum size of the result. `limit=0` implies no maximum (default) + - `keep`: whether empty fields should be kept in the result. Default is `false` without + a `chars` argument, `true` with a `chars` argument. # Examples ```jldoctest