# \#strings

**URL:** https://discourse.julialang.org/tag/strings/73.md?page=6

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 7

---

## [Print string with multiple lines without identation](https://discourse.julialang.org/t/print-string-with-multiple-lines-without-identation/61171)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 3\
**Last updated:** [May 14, 2021, 6:15pm UTC](https://discourse.julialang.org/t/print-string-with-multiple-lines-without-identation/61171 "2021-05-14T18:15:38Z")

</div>

Is there some macro that allows me to write strings with multiple lines removing the identiation of the code? Meaning: julia\> println("function f(x) y = x + 1 return y …

---

## [How to use string substitution in variable names](https://discourse.julialang.org/t/how-to-use-string-substitution-in-variable-names/55192)

<div class="topic-metadata">

**Author:** [@samerb](https://discourse.julialang.org/u/samerb)\
**Replies:** 15\
**Last updated:** [May 2, 2021, 8:35pm UTC](https://discourse.julialang.org/t/how-to-use-string-substitution-in-variable-names/55192 "2021-05-02T20:35:33Z")

</div>

I would like to do something like the following but that doesn’t work. How can I do this? Maybe use $ somehow? Edit: To be clear, I am trying to create the first 7 unit vectors. Thanks for i in 1:7 e\_i = zeros(7) …

---

## [Text to data-structure declaritively](https://discourse.julialang.org/t/text-to-data-structure-declaritively/59066)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 0\
**Last updated:** [April 12, 2021, 2:16am UTC](https://discourse.julialang.org/t/text-to-data-structure-declaritively/59066 "2021-04-12T02:16:10Z")

</div>

To convert: X = "John.Smith,20" to a named tuple Tup = (First\_Name = "John", Last\_Name = "Smith", Age = 20 ) I usually do something like: Tup = (First\_Name, Last\_Name, Age) = @pipe split("John.Smith,20", '.' ) |\>…

---

## [Better way to clean and normalize a DataFrame of strings?](https://discourse.julialang.org/t/better-way-to-clean-and-normalize-a-dataframe-of-strings/59043)

<div class="topic-metadata">

**Author:** [@ben-schulz](https://discourse.julialang.org/u/ben-schulz)\
**Replies:** 4\
**Last updated:** [April 12, 2021, 1:19am UTC](https://discourse.julialang.org/t/better-way-to-clean-and-normalize-a-dataframe-of-strings/59043 "2021-04-12T01:19:32Z")

</div>

hi there, i have a corpus of messy CSVs with matching columns but irregular formatting, so that a column ( say A ) often has some values with an unwanted metadata prefix, and other values without, like so: Row │ A …

---

## [Did Julia 1.6 introduced a regression for regex properties?](https://discourse.julialang.org/t/did-julia-1-6-introduced-a-regression-for-regex-properties/58076)

<div class="topic-metadata">

**Author:** [@D\_A](https://discourse.julialang.org/u/D_A)\
**Replies:** 2\
**Last updated:** [March 30, 2021, 7:08pm UTC](https://discourse.julialang.org/t/did-julia-1-6-introduced-a-regression-for-regex-properties/58076 "2021-03-30T19:08:12Z")

</div>

Hello. It seems the latest Julia release (nice job, by the way!) introduced a strange behaviour for regex properties, especially with scripts… text = "aa bb" text |\> collect # 'a': ASCII/Unicode U+0061 (category Ll: Le…

---

## [Missing ascii/unicode](https://discourse.julialang.org/t/missing-ascii-unicode/57990)

<div class="topic-metadata">

**Author:** [@Wei\_Yang](https://discourse.julialang.org/u/Wei_Yang)\
**Replies:** 6\
**Last updated:** [March 26, 2021, 1:55pm UTC](https://discourse.julialang.org/t/missing-ascii-unicode/57990 "2021-03-26T13:55:17Z")

</div>

When I run for i in 1:3000 print(Char(i)) end many of the characters appeared as question marks. I understand that this is most likely an windows OS problem, but just wondering if anyone have encountered this issue be…

---

## [Convert string encoding to UTF-8](https://discourse.julialang.org/t/convert-string-encoding-to-utf-8/57782)

<div class="topic-metadata">

**Author:** [@Thomas\_Lei](https://discourse.julialang.org/u/Thomas_Lei)\
**Replies:** 2\
**Last updated:** [March 23, 2021, 4:54pm UTC](https://discourse.julialang.org/t/convert-string-encoding-to-utf-8/57782 "2021-03-23T16:54:12Z")

</div>

Hi all, Somewhere in my code I read strings which contains unicode characters. For example, the reading output is: myString = "caf\\xe9" I’d like this string to be parsed as myString = "café" I played along with St…

---

## [Converting user-supplied strings/text to EBCDIC hexadecimal characters](https://discourse.julialang.org/t/converting-user-supplied-strings-text-to-ebcdic-hexadecimal-characters/56120)

<div class="topic-metadata">

**Author:** [@tg\_15](https://discourse.julialang.org/u/tg_15)\
**Replies:** 3\
**Last updated:** [February 27, 2021, 8:39pm UTC](https://discourse.julialang.org/t/converting-user-supplied-strings-text-to-ebcdic-hexadecimal-characters/56120 "2021-02-27T20:39:35Z")

</div>

I am currently trying to explore how to convert user-supplied plaintext to hexadecimal characters in ASCII and EBCDIC. The website I’m developing requires the user to supply a string (256 chars min), select ASCII or EBCD…

---

## [Parsing Strings as Strings](https://discourse.julialang.org/t/parsing-strings-as-strings/13833)

<div class="topic-metadata">

**Author:** [@nphair](https://discourse.julialang.org/u/nphair)\
**Replies:** 7\
**Last updated:** [February 18, 2021, 1:31pm UTC](https://discourse.julialang.org/t/parsing-strings-as-strings/13833 "2021-02-18T13:31:15Z")

</div>

I was playing around with parse the other day and was a bit surprised by, julia\> str = "foo" julia\> parse(String, str) ERROR: MethodError: no method matching parse(::Type{String}, ::String) and similarly, julia\> str =…

---

## [Concatenating bit strings](https://discourse.julialang.org/t/concatenating-bit-strings/54950)

<div class="topic-metadata">

**Author:** [@bsuwal](https://discourse.julialang.org/u/bsuwal)\
**Replies:** 4\
**Last updated:** [February 11, 2021, 4:42pm UTC](https://discourse.julialang.org/t/concatenating-bit-strings/54950 "2021-02-11T16:42:18Z")

</div>

Say I have a bit string x = UInt(1) (which is 0x01) and y = UInt(2) (which is 0x02). Is there a way to concatenate these bit strings using something like x \* y so that the resulting bit string would represent 0x01 0x02 …

---

## [Effective Text Extraction from Documents (PDFs)](https://discourse.julialang.org/t/effective-text-extraction-from-documents-pdfs/54889)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 2\
**Last updated:** [February 9, 2021, 10:48pm UTC](https://discourse.julialang.org/t/effective-text-extraction-from-documents-pdfs/54889 "2021-02-09T22:48:29Z")

</div>

Hi all, Question for those involved with text extraction pipelines (or ETL pipelines for that matter): In Julia, what works best for you when doing text extraction from PDFs? In my case, I am simplifying the problem t…

---

## [Removing characters from String](https://discourse.julialang.org/t/removing-characters-from-string/53962)

<div class="topic-metadata">

**Author:** [@LinasBa](https://discourse.julialang.org/u/LinasBa)\
**Replies:** 15\
**Last updated:** [January 26, 2021, 3:04pm UTC](https://discourse.julialang.org/t/removing-characters-from-string/53962 "2021-01-26T15:04:18Z")

</div>

Hello, I would like to remove some characters from String, but that seems to be really complicated in Julia :frowning: Example: str = "ž1ž1" r = r"1" idx = eachmatch(r, str) .|\> o -\> o.offset result = String(deleteat!…

---

## [How to adjust string into item in JSON structure](https://discourse.julialang.org/t/how-to-adjust-string-into-item-in-json-structure/52988)

<div class="topic-metadata">

**Author:** [@Laco\_Kovac](https://discourse.julialang.org/u/Laco_Kovac)\
**Replies:** 3\
**Last updated:** [January 7, 2021, 4:57pm UTC](https://discourse.julialang.org/t/how-to-adjust-string-into-item-in-json-structure/52988 "2021-01-07T16:57:27Z")

</div>

My code is validating input json using JSONSchema.isvalid If it is not valid, code takes string returned by JSONSchema.diagnose and it should return that string as json containing error. The code looks like this: dia…

---

## [Question about SubString in DataFrames](https://discourse.julialang.org/t/question-about-substring-in-dataframes/52910)

<div class="topic-metadata">

**Author:** [@florian](https://discourse.julialang.org/u/florian)\
**Replies:** 1\
**Last updated:** [January 6, 2021, 2:38am UTC](https://discourse.julialang.org/t/question-about-substring-in-dataframes/52910 "2021-01-06T02:38:41Z")

</div>

Hi everyone, I have a question about SubStrings. The documentation states that they are views into a parent string. Suppose I want to clean up the following DataFrame: df = DataFrame(type\_year = \[“Red 2019”, “Red 2020…

---

## [String Interpolation Question](https://discourse.julialang.org/t/string-interpolation-question/52752)

<div class="topic-metadata">

**Author:** [@Bryan\_So](https://discourse.julialang.org/u/Bryan_So)\
**Replies:** 4\
**Last updated:** [January 4, 2021, 7:14pm UTC](https://discourse.julialang.org/t/string-interpolation-question/52752 "2021-01-04T19:14:42Z")

</div>

HI, very simple beginner’s question about string interpolation: If a variable is a struct that has a Base.string method. Does string interpolation use that method? This is most curious: struct Expression\_Symbol d…

---

## [How to do escape\_string](https://discourse.julialang.org/t/how-to-do-escape-string/52401)

<div class="topic-metadata">

**Author:** [@Zaim\_Awang](https://discourse.julialang.org/u/Zaim_Awang)\
**Replies:** 15\
**Last updated:** [December 26, 2020, 3:41pm UTC](https://discourse.julialang.org/t/how-to-do-escape-string/52401 "2020-12-26T15:41:56Z")

</div>

I am trying to use escape\_string because as per documentation, “Backslashes ( \\ ) are escaped with a double-backslash ( "\\\\" )”. This is what I tried: mypath1 = escape\_string("C:\\Users\\User\\Dropbox\\codes\\JULIA\\stock1\\"…

---

## [Addressing raw string syntax and semantics for Julia 2.0?](https://discourse.julialang.org/t/addressing-raw-string-syntax-and-semantics-for-julia-2-0/51343)

<div class="topic-metadata">

**Author:** [@cce](https://discourse.julialang.org/u/cce)\
**Replies:** 58\
**Last updated:** [December 23, 2020, 11:16pm UTC](https://discourse.julialang.org/t/addressing-raw-string-syntax-and-semantics-for-julia-2-0/51343 "2020-12-23T23:16:45Z")

</div>

This discussion (as of December 17th) is now arguing a paired delimiter (such as double-angle brackets ⟪...⟫) could offer improved semantics for raw strings, used by regular expressions and other string notations, by neg…

---

## [Put an underscore before all digits in a string](https://discourse.julialang.org/t/put-an-underscore-before-all-digits-in-a-string/50195)

<div class="topic-metadata">

**Author:** [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Replies:** 1\
**Last updated:** [November 15, 2020, 6:13pm UTC](https://discourse.julialang.org/t/put-an-underscore-before-all-digits-in-a-string/50195 "2020-11-15T18:13:05Z")

</div>

I’ve tried reading these docs Introducing Julia/Strings and characters - Wikibooks, open books for an open world and these docs Strings · The Julia Language and I’ve tried several things, such as: replace("x1", r"\\d+" =\>…

---

## [How to remove quotes folowing variable interpolation in Run() command?](https://discourse.julialang.org/t/how-to-remove-quotes-folowing-variable-interpolation-in-run-command/49849)

<div class="topic-metadata">

**Author:** [@Fred](https://discourse.julialang.org/u/Fred)\
**Replies:** 4\
**Last updated:** [November 9, 2020, 5:19pm UTC](https://discourse.julialang.org/t/how-to-remove-quotes-folowing-variable-interpolation-in-run-command/49849 "2020-11-09T17:19:12Z")

</div>

Hi, I try to use Julia to start and existing R software. But I have problems because I dont know how to remove extra quotes added by variable interpolation. Thanks ! See example here (it is a toy example, I have a muc…

---

## [CImGui Greek Characters](https://discourse.julialang.org/t/cimgui-greek-characters/28918)

<div class="topic-metadata">

**Author:** [@wiktorkujawa](https://discourse.julialang.org/u/wiktorkujawa)\
**Replies:** 6\
**Last updated:** [November 5, 2020, 7:10pm UTC](https://discourse.julialang.org/t/cimgui-greek-characters/28918 "2020-11-05T19:10:50Z")

</div>

Is possible to add some greek characters into CImGui text windows? I tried on demo example and I figured out that all the ttf files in fonts directory of CImGui packages are out of every language except latin chars, so …

---

## [How to create strings combining all letters?](https://discourse.julialang.org/t/how-to-create-strings-combining-all-letters/49550)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 6\
**Last updated:** [November 4, 2020, 12:14am UTC](https://discourse.julialang.org/t/how-to-create-strings-combining-all-letters/49550 "2020-11-04T00:14:22Z")

</div>

Hello. I’m trying to learn Julia by replicating simple R code in Julia but I’m not even able to create a toy example :anguished: Let me ask some simple question. In R there is a function letters, which gives you a vec…

---

## [Iterating over String changes its Structure to a an array Characters](https://discourse.julialang.org/t/iterating-over-string-changes-its-structure-to-a-an-array-characters/49417)

<div class="topic-metadata">

**Author:** [@Jim\_Beck](https://discourse.julialang.org/u/Jim_Beck)\
**Replies:** 6\
**Last updated:** [November 3, 2020, 3:37pm UTC](https://discourse.julialang.org/t/iterating-over-string-changes-its-structure-to-a-an-array-characters/49417 "2020-11-03T15:37:02Z")

</div>

I have a list of strings that I’m attempting to compare to a unique other string. I have a function that compares each string character by character, counting differences at each location. function compareStrings(sequen…

---

## [Jaccard distance of each combo of elements in 2 lists](https://discourse.julialang.org/t/jaccard-distance-of-each-combo-of-elements-in-2-lists/49483)

<div class="topic-metadata">

**Author:** [@lorb24](https://discourse.julialang.org/u/lorb24)\
**Replies:** 2\
**Last updated:** [November 2, 2020, 10:04pm UTC](https://discourse.julialang.org/t/jaccard-distance-of-each-combo-of-elements-in-2-lists/49483 "2020-11-02T22:04:44Z")

</div>

What’s the most efficient way to get the Jaccard distance of each combo of elements in 2 lists? Let’s say I have 2 arrays that look like this: x= "ap p le" "or an ge" "ap pl e" "ap pl e” ”or an ge" "ho ne yc ri sp ap …

---

## [How does Char get stored?](https://discourse.julialang.org/t/how-does-char-get-stored/49366)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 7\
**Last updated:** [October 31, 2020, 7:47pm UTC](https://discourse.julialang.org/t/how-does-char-get-stored/49366 "2020-10-31T19:47:55Z")

</div>

I was basically under the impression that for 4 byte UTF-8 characters Char stored a UInt32 that was the codepoint containing all 4 codeunits. This is clearly not the case, as reinterpret disagrees with the codepoint j…

---

## [Substituting Expression for Symbol in Nested Expression](https://discourse.julialang.org/t/substituting-expression-for-symbol-in-nested-expression/36366)

<div class="topic-metadata">

**Author:** [@r-b0](https://discourse.julialang.org/u/r-b0)\
**Replies:** 5\
**Last updated:** [October 22, 2020, 12:55pm UTC](https://discourse.julialang.org/t/substituting-expression-for-symbol-in-nested-expression/36366 "2020-10-22T12:55:54Z")

</div>

Let’s suppose I have a situation which necessitates substituting an expression for a symbol in a nested expression. Let’s further suppose that I am unable to acomplish this by acting on the string before parsing using s…

---

## [How to read a string from a file with interpolation](https://discourse.julialang.org/t/how-to-read-a-string-from-a-file-with-interpolation/47913)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 7\
**Last updated:** [October 7, 2020, 8:22pm UTC](https://discourse.julialang.org/t/how-to-read-a-string-from-a-file-with-interpolation/47913 "2020-10-07T20:22:02Z")

</div>

The file “test.txt” contains a single line: I am $me The following is intended to simply read the string and store the interpolated result in str: me = "Sam" str = read("test.txt", String); str == "I am Sam" false

---

## [What is regex?](https://discourse.julialang.org/t/what-is-regex/46215)

<div class="topic-metadata">

**Author:** [@string-dot-byte](https://discourse.julialang.org/u/string-dot-byte)\
**Replies:** 10\
**Last updated:** [September 10, 2020, 1:02pm UTC](https://discourse.julialang.org/t/what-is-regex/46215 "2020-09-10T13:02:55Z")

</div>

Hello, I have come across many programming terms inidcating regex which I am unsure of what it is. I have made research on this forum and on google but have not found any good explanation about the subject. What I und…

---

## [Please help me to find a easiest Algorithm for this case](https://discourse.julialang.org/t/please-help-me-to-find-a-easiest-algorithm-for-this-case/46186)

<div class="topic-metadata">

**Author:** [@xp-gamer](https://discourse.julialang.org/u/xp-gamer)\
**Replies:** 9\
**Last updated:** [September 8, 2020, 10:03pm UTC](https://discourse.julialang.org/t/please-help-me-to-find-a-easiest-algorithm-for-this-case/46186 "2020-09-08T22:03:39Z")

</div>

I am working on strings on Julia language. I working on a function where input string format is need to be converted to respective output mentioned below, please help me in finding a easier algorithm for this condition. …

---

## [MethodError: no method matching findall(::Regex, ::String)](https://discourse.julialang.org/t/methoderror-no-method-matching-findall-regex-string/44468)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 2\
**Last updated:** [August 7, 2020, 6:43am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-findall-regex-string/44468 "2020-08-07T06:43:16Z")

</div>

Would you help me? Is there any way, how to use function findall(::Regex,::String) in Julia ver1.1.1 Thank you in advance. Best

---

## [Multiple dispatch by String alias](https://discourse.julialang.org/t/multiple-dispatch-by-string-alias/43400)

<div class="topic-metadata">

**Author:** [@Boo](https://discourse.julialang.org/u/Boo)\
**Replies:** 9\
**Last updated:** [July 21, 2020, 8:01pm UTC](https://discourse.julialang.org/t/multiple-dispatch-by-string-alias/43400 "2020-07-21T20:01:07Z")

</div>

Hi there, Is it possible to make alias for String type some how which inherits all the logic from String and then make multiple dispatch by this custom type? For example: alias MyString = String # Pseudocode f(str…

[Previous page](https://discourse.julialang.org/tag/strings/73.md?match_all_tags=true&page=5&tags%5B%5D=strings)

[Next page](https://discourse.julialang.org/tag/strings/73.md?match_all_tags=true&page=7&tags%5B%5D=strings)
