Skip to content

Strings

Jean Dubois edited this page Mar 10, 2024 · 6 revisions

Strings

In Nougaro, Strings work mostly like in Python:

  • Quoted by ", ' or «»
  • Escape characters:
    • \' : '
    • \" : "
    • : »
    • \n : backline
    • \t : tab
    • \\ : backslash
    • \xAA : unicode character number AA (hex)
    • \uAAAA : unicode character number AAAA (hex)
    • \UAAAAAAAA : unicode character number AAAAAAAA (hex)
    • \N{NAME} : unicode character with name NAME. Returns SyntaxError if it doesn’t exist.

Operations

  • You can add strings: 'str' + 'str' = 'strstr'
  • Or multiply them: 'str' * 3 = 'strstrstr'

Examples

  • "Hello world"
  • 'Hello world'
  • "Hello " + 'world'
  • "Hello, " * 2 + 'world'
  • "Hello\nworld"
  • "Hello\tworld"
  • 'I\'m a str'
  • "He said: \"I'm a str\""
  • "\N{Latin Small Letter C with Cedilla}: \xe7"
  • "\N{Greek Small Letter Eta with Dasia and Oxia and Ypogegrammeni}: \u1F95"
  • "This is Person Shrugging (🤷): \U0001f937"
  • «French guillemets!»

Clone this wiki locally