web_urlEncode

文字列をURLエンコードされた文字列に変換します。


taiseiue | 2021-08-26

定義

名前空間: Alice.Net
アセンブリ: Losetta.Runtime.dll
ソースコード: Alice.Net.cs

web_urlEncode(string)

文字列をURLエンコードされた文字列に変換します。

AliceScript
namespace Alice.Net;
public string web_urlEncode(string text);
引数
text エンコードする文字列
戻り値
string エンコードされた文字列

対応
AliceScript RC1、RC2、GM、2.0、2.1、2.2、2.3、3.0、4
AliceSister GM、2.0、2.1、2.2、2.3、3.0、4
Losetta 0.8、0.9、0.10、0.11

次の例では、web_urlEncode関数を使用して文字列をHTMLエンコードし、その後web_urlDecode関数を使用してURLデコードしたものを表示します。

AliceScript
using Alice.Net;

var text = "<div class=\"row\">";

print("URLエンコード前のテキスト:{0}",text);

//HTMLエンコードする
text = web_urlencode(text);

print("URLエンコード後のテキスト:{0}",text);

//HTMLデコードする(元の文字列に戻る)
text = web_urldecode(text);

print("URLデコード後のテキスト:{0}",text);