Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.compiletime/scala.compiletime.ops/string

string

scala.compiletime.ops.string
objectstring

Attributes

Source
string.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Self type
string.type

Members list

Type members

Types

infixtype+[X <:String,Y <:String] <:String

Concatenation of twoString singleton types.

Concatenation of twoString singleton types.

import compiletime.ops.string.*val hello: "hello " + "world" = "hello world"

Attributes

Source
string.scala
typeCharAt[S <:String,Idx <:Int] <:Char

Returns the Char type at the specified index. An index ranges from 0 to Length[S] - 1. The first Char of the sequence is at index 0, the next at index 1, and so on.

Returns the Char type at the specified index. An index ranges from 0 to Length[S] - 1. The first Char of the sequence is at index 0, the next at index 1, and so on.

import string.*val c: CharAt["hello", 0] = 'h'

Attributes

Source
string.scala
typeLength[X <:String] <:Int

Length of aString singleton type.

Length of aString singleton type.

import compiletime.ops.string.*val helloSize: Length["hello"] = 5

Attributes

Source
string.scala
typeMatches[S <:String,Regex <:String] <:Boolean

Tests if thisString singleton type matches the given regular expressionString singleton type.

Tests if thisString singleton type matches the given regular expressionString singleton type.

import compiletime.ops.string.*val x: Matches["unhappy", "un.*"] = true

Attributes

Source
string.scala
typeSubstring[S <:String,IBeg <:Int,IEnd <:Int] <:String

Substring of aString singleton type, with a singleton type begin inclusive indexIBeg, and a singleton type exclusive end indexIEnd. The substring begins at the specified IBeg and extends to the character at index IEnd - 1. Thus the length of the substring is IEnd-IBeg.

Substring of aString singleton type, with a singleton type begin inclusive indexIBeg, and a singleton type exclusive end indexIEnd. The substring begins at the specified IBeg and extends to the character at index IEnd - 1. Thus the length of the substring is IEnd-IBeg.

import compiletime.ops.string.*val x: Substring["hamburger", 4, 8] = "urge"val y: Substring["smiles", 1, 5] = "mile"

Attributes

Source
string.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp