「VBScript入門」Right関数を使うサンプル

2020年12月17日

説明
Right(strString, mojiCnt)
文字列の右端から指定された文字数分の文字列を返します。
使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Dim strRes
Dim strPa
strPa = "Studyskillinarkgame.com"
strRes = Right(strPa,7) '右端から文字列7文字数
WScript.Echo "result1: " & strRes
strRes = Right(strPa, Len(strPa) -3)'Len関数
WScript.Echo "result2: "& strRes
Dim strRes Dim strPa strPa = "Studyskillinarkgame.com" strRes = Right(strPa,7) '右端から文字列7文字数 WScript.Echo "result1: " & strRes strRes = Right(strPa, Len(strPa) -3)'Len関数 WScript.Echo "result2: "& strRes
Dim strRes
Dim strPa
strPa = "Studyskillinarkgame.com"
strRes = Right(strPa,7) '右端から文字列7文字数                
WScript.Echo "result1: " & strRes   
strRes = Right(strPa, Len(strPa) -3)'Len関数
WScript.Echo "result2: "& strRes

実行結果
result1:ame.com
result2:dyskillinarkgame.com

VBScript

Posted by arkgame