StringExtensions クラス
System.Stringクラスを拡張します。 このクラスは静的です。
継承
System.Object
    StringExtensions
  継承されたメンバー
      System.Object.Equals(System.Object)
    
    
      System.Object.Equals(System.Object, System.Object)
    
    
      System.Object.GetHashCode()
    
    
      System.Object.GetType()
    
    
      System.Object.MemberwiseClone()
    
    
      System.Object.ReferenceEquals(System.Object, System.Object)
    
    
      System.Object.ToString()
    
  名前空間: ExapisSOP.Utils
アセンブリ: ExapisSOP.dll
構文
public static class StringExtensions
  メソッド 一覧
| 編集/提案 ソースを表示Abridge(String, Int32)
指定された文字列を指定された文字数に省略します。
宣言
public static string Abridge(this string s, int count)
  引数
| 型 | 名前 | 説明 | 
|---|---|---|
| System.String | s | 省略する文字列です。  | 
      
| System.Int32 | count | 省略後の文字数です。  | 
      
戻り値
| 型 | 説明 | 
|---|---|
| System.String | 指定された文字数に収まる文字列です。  | 
      
脚注
sの文字数がcountより大きい場合は、
先頭の文字に三つのピリオドを付加して省略後の文字数に合わせます。
count-3sの文字数がcountより小さい場合は、
System.String.PadRight(System.Int32)を利用して省略後の文字数に合わせます。
sの文字数がcountと同じ場合はそのまま返します。
FitToLine(String)
指定された文字列を1行に収めます。
宣言
public static string FitToLine(this string s)
  引数
| 型 | 名前 | 説明 | 
|---|---|---|
| System.String | s | 1行に収める必要のある文字列です。  | 
      
戻り値
| 型 | 説明 | 
|---|---|
| System.String | 改行やタブが削除され、1行で表現された文字列です。  | 
      
TryToBoolean(String, out Boolean)
指定された文字列を論理値へ変換します。 true、false以外の一部の単語にも対応しています。
宣言
public static bool TryToBoolean(this string s, out bool result)
  引数
| 型 | 名前 | 説明 | 
|---|---|---|
| System.String | s | 変換する文字列です。  | 
      
| System.Boolean | result | 変換結果を格納する変数です。  | 
      
戻り値
| 型 | 説明 | 
|---|---|
| System.Boolean | 指定された文字列が有効な論理値を表す場合はtrue、それ以外の場合はfalseを返します。  |