Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8724289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:47:58+00:00 2026-06-13T07:47:58+00:00

How can I write a character literal for a vertical tab (‘\v’, ASCII 11)

  • 0

How can I write a character literal for a vertical tab (‘\v’, ASCII 11) in Scala?

'\v' doesn’t work. (invalid escape character)
'\11' should be it, but…

scala> '\11'.toInt
res13: Int = 9

But 9 is the ASCII code for a normal tab(‘\t’). What is going on there?

EDIT: This works and produces the right character, but I’d still like to know the syntax for a literal.

val c:Char = 11
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:47:59+00:00Added an answer on June 13, 2026 at 7:47 am

    You need to use '\13'. It’s in octal.

    For more information see Scala Language Specification.

    1.3.4 Character Literals

    Syntax:

    characterLiteral ::= ‘\’’ printableChar ‘\’’ | ‘\’’ charEscapeSeq ‘\’’

    A character literal is a single character enclosed in quotes. The
    character is either a printable unicode character or is described by
    an escape sequence (§1.3.6).

    Example 1.3.4 Here are some character
    literals: ’a’ ’\u0041’ ’\n’ ’\t’ Note that ‘\u000A’ is not a valid
    character literal because Unicode conversion is done before literal
    parsing and the Unicode character \u000A (line feed) is not a
    printable character. One can use instead the escape sequence ‘\n’ or
    the octal escape ‘\12’ (§1.3.6).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

May I know how I can a write a character string into a 2D
how can i write the newline character as a string to a file java.
How can I write a , (comma) character in the SLIME emacs window? The
You can write UTF-8/16/32 string literals in C++11 by prefixing the string literal with
I have a UITextView, user can write maximum 160 character in the textView. How
How can I write a function that returns the index of a single character
How can I write an insert statement which includes the & character? For example,
You can write //google.com instead of http://google.com and https://google.com where // is relative to
I can write an assertion message one of two ways. Stating success: assertEquals( objects
We can write CSS as the following types: Inline CSS Embedded CSS External CSS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.