Hello
I saw that the function “chop” removes the last character of a given string. How to do the same for the first one ?
Thank’s
Michael.
Hello
I saw that the function “chop” removes the last character of a given string. How to do the same for the first one ?
Thank’s
Michael.
Perhaps:
julia> snip(s::String) = s[nextind(s,1):end];
julia> snip("αβγ")
"βγ"
Sure, that’ll do. Thank’s !
This remove first character not last?
That was the question, you can use chop
for the last character.
Thanks a lot, I was in need of it now, to convert jpg
files into bmp
, and done with this code:
using Images, FileIO, ImageMagick
files = cd(readdir, pwd())
for f in files
if occursin(r".*\.jpg\z", f) == true
img = load(f)
fn = chop(f, tail=4)
save("rawdata/$fn.bmp", img)
end
end
You can also see splitext
which is made for that purpose.