ExcelWork.info

文字列:文字列右から指定文字数取得(Right 関数,RightB 関数)

Right 関数・RightB 関数 の使い方


【書式】

result_right = Right ( string, length )

result_rightb = RightB ( string, length )


引数・戻り値

  • string  ・・・  任意の文字列・文字列式を指定します。
  • length  ・・・  取得する文字の長さ(0 以上の整数値)を指定します。
  • result_right  ・・・  引数 string の右端から length文字分を取得した文字列(文字列型:String)。
  • result_rightb  ・・・  引数 string の右端から lengthバイト分を取得した文字列(文字列型:String)。

引数 string が、Null 値 を含む場合は、Null 値 を返します

引数 length に、0 を指定した場合は、長さ 0 の文字列 (“”) を返します。また、string の文字数以上の値を指定した場合は、string 全体を返します。



Right 関数・RightB 関数 の使用例

サンプルVBAソース


実行結果