typealias String.UnicodeScalarView.Index
typealias String.UnicodeScalarView.Element
typealias String.UnicodeScalarView.Indices
typealias String.UnicodeScalarView.SubSequence
Availability
Technology
@frozen struct UnicodeScalarView
You can access a string’s view of Unicode scalar values by using its unicode
property. Unicode scalar values are the 21-bit codes that are the basic unit of Unicode. Each scalar value is represented by a Unicode
instance and is equivalent to a UTF-32 code unit.
あなたは文字列の持つビューのユニコードスカラー値にアクセスすることが、それのunicode
プロパティを使うことで行えます。ユニコードスカラー値は21ビットコードです、それはユニコードの基本的な単位です。各スカラー値は、Unicode
インスタンスによって表されて、ひとつのUTF-32コード単位と同等です。
Some characters that are visible in a string are made up of more than one Unicode scalar value. In that case, a string’s unicode
view contains more elements than the string itself.
文字列の中に見られるいくつかの文字は、1つ以上のユニコードスカラー値で構成されます。その場合には、文字列のもつunicode
ビューは、その文字列それ自体より多くの要素を含みます。
You can convert a String
instance back into a string using the String
type’s init(_:)
initializer.
あなたは、String
インスタンスを逆にひとつの文字列へと変換することが、String
型のもつinit(_:)
イニシャライザを使って行えます。
typealias String.UnicodeScalarView.Index
typealias String.UnicodeScalarView.Element
typealias String.UnicodeScalarView.Indices
typealias String.UnicodeScalarView.SubSequence
init()
init<S>(S)
init(repeating: Unicode.Scalar, count: Int)
var count: Int
var customMirror : Mirror
var customPlaygroundQuickLook : _PlaygroundQuickLook
var debugDescription : String
var description: String
var endIndex : String.UnicodeScalarView.Index
var first: Unicode.Scalar?
var indices: DefaultIndices<String.UnicodeScalarView>
var isEmpty : Bool
var last: Unicode.Scalar?
var lazy: LazySequence<String.UnicodeScalarView>
map
and filter
, are implemented lazily.
このシーケンスと同じ要素を含んでいるシーケンス、しかしそれの上で何らかの演算、例えばmap
やfilter
が遅延に実装されます。
var startIndex : String.UnicodeScalarView.Index
var underestimatedCount : Int
func allSatisfy ((Unicode.Scalar) -> Bool) -> Bool
func append(Unicode.Scalar)
func append<S>(contentsOf : S)
func append<S>(contentsOf : S)
func applying(CollectionDifference<Unicode.Scalar>) -> String.UnicodeScalarView?
func compactMap <ElementOfResult>((Unicode.Scalar) -> ElementOfResult?) -> [ElementOfResult]
nil
results of calling the given transformation with each element of this sequence.
指定された変換をこのシーケンスの各要素で呼び出す結果で非-nil
のものを含んでいる配列を返します。
func contains(Unicode.Scalar) -> Bool
func contains(where: (Unicode.Scalar) -> Bool) -> Bool
func difference<C>(from: C) -> CollectionDifference<Unicode.Scalar>
func difference<C>(from: C, by: (C.Element, Unicode.Scalar) -> Bool) -> CollectionDifference<Unicode.Scalar>
func distance(from: String.UnicodeScalarView.Index, to: String.UnicodeScalarView.Index) -> Int
func drop(while: (Unicode.Scalar) -> Bool) -> Substring.UnicodeScalarView
predicate
returns true
and returning the remaining elements.
predicate
がtrue
を返す間は要素を飛ばして残りの要素を返すことによって、ある下位シーケンスを返します。
func dropFirst (Int) -> Substring.UnicodeScalarView
func dropLast (Int) -> Substring.UnicodeScalarView
func elementsEqual <OtherSequence>(OtherSequence) -> Bool
func elementsEqual <OtherSequence>(OtherSequence, by: (Unicode.Scalar, OtherSequence.Element) -> Bool) -> Bool
func enumerated() -> EnumeratedSequence<String.UnicodeScalarView>
func filter((Unicode.Scalar) -> Bool) -> String.UnicodeScalarView
func first(where: (Unicode.Scalar) -> Bool) -> Unicode.Scalar?
func firstIndex (of: Unicode.Scalar) -> String.Index?
func firstIndex (where: (Unicode.Scalar) -> Bool) -> String.Index?
func flatMap <SegmentOfResult>((Unicode.Scalar) -> SegmentOfResult) -> [SegmentOfResult.Element]
func flatMap <ElementOfResult>((Unicode.Scalar) -> ElementOfResult?) -> [ElementOfResult]
Deprecated
非推奨
func forEach ((Unicode.Scalar) -> Void)
for
-in
loop.
指定されたクロージャをそのシーケンスの各要素上でfor
-in
ループと同じ順番で呼び出します。
func formIndex (inout String.Index, offsetBy : Int)
func formIndex (inout String.Index, offsetBy : Int, limitedBy : String.Index) -> Bool
func formIndex (after: inout String.Index)
func formIndex (before: inout String.Index)
func index(String.Index, offsetBy : Int) -> String.Index
func index(String.Index, offsetBy : Int, limitedBy : String.Index) -> String.Index?
func index(after: String.UnicodeScalarView.Index) -> String.UnicodeScalarView.Index
i
.
i
の後の、以降に続く場所を返します。
func index(before: String.UnicodeScalarView.Index) -> String.UnicodeScalarView.Index
i
.
i
前の、以前に続く場所を返します。
func index(of: Unicode.Scalar) -> String.Index?
func insert(Unicode.Scalar, at: String.Index)
func insert<C>(contentsOf : C, at: String.Index)
func last(where: (Unicode.Scalar) -> Bool) -> Unicode.Scalar?
func lastIndex (of: Unicode.Scalar) -> String.Index?
func lastIndex (where: (Unicode.Scalar) -> Bool) -> String.Index?
func lexicographicallyPrecedes <OtherSequence>(OtherSequence) -> Bool
<
) to compare elements.
そのシーケンスが別のシーケンスの前に来るかどうかを、ある語彙筆記的順序(字典)順序において、より小さい演算子(<
)を使って要素を比較して、指し示すブール値を返します。
func lexicographicallyPrecedes <OtherSequence>(OtherSequence, by: (Unicode.Scalar, Unicode.Scalar) -> Bool) -> Bool
func makeIterator () -> String.UnicodeScalarView.Iterator
func map<T>((Unicode.Scalar) -> T) -> [T]
func max() -> Unicode.Scalar?
func max(by: (Unicode.Scalar, Unicode.Scalar) -> Bool) -> Unicode.Scalar?
func min() -> Unicode.Scalar?
func min(by: (Unicode.Scalar, Unicode.Scalar) -> Bool) -> Unicode.Scalar?
func popLast () -> Unicode.Scalar?
func prefix(Int) -> Substring.UnicodeScalarView
func prefix(through: String.Index) -> Substring.UnicodeScalarView
func prefix(upTo : String.Index) -> Substring.UnicodeScalarView
func prefix(while: (Unicode.Scalar) -> Bool) -> Substring.UnicodeScalarView
predicate
returns false
and skipping the remaining elements.
predicate
がfalse
を返すまで冒頭の要素を含んでいて残りの要素を飛ばしている、ある下位シーケンスを返します。
func randomElement () -> Unicode.Scalar?
func randomElement <T>(using: inout T) -> Unicode.Scalar?
func reduce<Result>(Result, (Result, Unicode.Scalar) -> Result) -> Result
func reduce<Result>(into: Result, (inout Result, Unicode.Scalar) -> ()) -> Result
func remove(at: String.Index) -> Unicode.Scalar
func removeAll (keepingCapacity : Bool)
func removeAll (where: (Unicode.Scalar) -> Bool)
func removeFirst () -> Unicode.Scalar
func removeFirst (Int)
func removeLast () -> Unicode.Scalar
func removeLast (Int)
func removeSubrange (Range<String.Index>)
func removeSubrange <R>(R)
func replaceSubrange <C>(Range<String.UnicodeScalarView.Index>, with: C)
func replaceSubrange <C, R>(R, with: C)
func reserveCapacity (Int)
func reversed() -> ReversedCollection<String.UnicodeScalarView>
func shuffled() -> [Unicode.Scalar]
func shuffled<T>(using: inout T) -> [Unicode.Scalar]
func sorted() -> [Unicode.Scalar]
func sorted(by: (Unicode.Scalar, Unicode.Scalar) -> Bool) -> [Unicode.Scalar]
func split(maxSplits : Int, omittingEmptySubsequences : Bool, whereSeparator : (Unicode.Scalar) -> Bool) -> [Substring.UnicodeScalarView]
func split(separator: Unicode.Scalar, maxSplits : Int, omittingEmptySubsequences : Bool) -> [Substring.UnicodeScalarView]
func starts<PossiblePrefix>( with: PossiblePrefix) -> Bool
func starts<PossiblePrefix>( with: PossiblePrefix, by: (Unicode.Scalar, PossiblePrefix.Element) -> Bool) -> Bool
func suffix(Int) -> Substring.UnicodeScalarView
func suffix(from: String.Index) -> Substring.UnicodeScalarView
func withContiguousStorageIfAvailable <R>((UnsafeBufferPointer<Unicode.Scalar>) -> R) -> R?
subscript(String.UnicodeScalarView.Index) -> Unicode.Scalar
subscript(Range<String.UnicodeScalarView.Index>) -> String.UnicodeScalarView.SubSequence
subscript<R>(R) -> Substring.UnicodeScalarView
static func + <Other>(Other, String.UnicodeScalarView) -> String.UnicodeScalarView
static func + <Other>(String.UnicodeScalarView, Other) -> String.UnicodeScalarView
static func + <Other>(String.UnicodeScalarView, Other) -> String.UnicodeScalarView
static func += <Other>(inout String.UnicodeScalarView, Other)
struct String.UnicodeScalarView.Iterator
struct Substring
protocol StringProtocol
struct String.Index
struct String.UTF16View
struct String.UTF8View
struct String.Iterator