A Matter of Character

In which I get a foreshadowing of future opportunities (and bugs) by learning about the the difference between a Character and a String in Julia

Capulet's Orchard
JuliaLang
miniblog
Author
Published

August 25, 2025

Photo by Camille Orgel on Unsplash

Photo by Camille Orgel on Unsplash

Coming from R and Python, I used double (") and single (') quotation marks rather interchangably. Now with Julia I need to be very strict to use " for Strings and ' for Chars.1

To demonstrate this, look at the following:

begin
  a_string = "a"
  typeof(a_string)
end
String
begin
  a_character = 'a'
  typeof(a_character)
end
Char

Apparently this is common in other programming languages, but it is definitely new to me. I hope, I will not get stuck on future code projects by carelessly using the “wrong” quotation mark…

However, learning about the possibilites, this Char type offers (such as Integer arithmetic), I got an idea for a small project in the following post.

Footnotes

  1. Check out the Julia manual for more details: https://docs.julialang.org/en/v1/manual/strings/#man-characters↩︎

Reuse

Citation

BibTeX citation:
@misc{gebhard2025,
  author = {Gebhard, Christian},
  title = {A {Matter} of {Character}},
  date = {2025-08-25},
  url = {https://christiangebhard.com/posts/2025-08.06-julia-CO-05/},
  langid = {en}
}
For attribution, please cite this work as:
Gebhard, Christian. 2025. “A Matter of Character.” August 25, 2025. https://christiangebhard.com/posts/2025-08.06-julia-CO-05/.