次の方法で共有


Char.IsControl メソッド (Char)

指定した Unicode 文字が、制御文字かどうかを示します。

Overloads Public Shared Function IsControl( _
   ByVal c As Char _) As Boolean
[C#]
public static bool IsControl(charc);
[C++]
public: static bool IsControl(__wchar_tc);
[JScript]
public static function IsControl(
   c : Char) : Boolean;

パラメータ

  • c
    Unicode 文字。

戻り値

c が制御文字である場合は true 。それ以外の場合は false

解説

有効な制御文字は、 UnicodeCategory のカテゴリ Control のメンバです。

使用例

[Visual Basic, C#, C++] IsControl のサンプルを次に示します。

 
imports System

Module IsControlSample

    Sub Main()

        Dim chTab As Char
        chTab = Chr(9)      ' Tab character
        Dim str As String
        str = "sample string"

        Console.WriteLine(Char.IsControl(chTab))    ' Output: "True"
        Console.WriteLine(Char.IsControl(str, 6))   ' Output: "False"

    End Sub

End Module

[C#] 
using System;

public class IsControlSample {
    public static void Main() {
        string str = "sample string";

        Console.WriteLine(Char.IsControl('\t'));    // Output: "True"
        Console.WriteLine(Char.IsControl(str, 7));    // Output: "False"
    }
}

[C++] 
#using <mscorlib.dll>
using namespace System;

int main() {
    String* str = "sample string";

    Console::WriteLine(Char::IsControl('\t'));    // Output: "True"
    Console::WriteLine(Char::IsControl(str, 7));    // Output: "False"
}

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET, Common Language Infrastructure (CLI) Standard

参照

Char 構造体 | Char メンバ | System 名前空間 | Char.IsControl オーバーロードの一覧