JavaScript 文字列操作 新しいページはコチラ

提供: yonewiki
移動: 案内, 検索
(文字コード変換(1文字→ISO Latin-1コード) charCodeAt)
(文字コード変換(1文字→ISO Latin-1コード) charCodeAt)
412行: 412行:
  
 
== '''文字コード変換(1文字→ISO Latin-1コード) charCodeAt ''' ==
 
== '''文字コード変換(1文字→ISO Latin-1コード) charCodeAt ''' ==
*strData14.charCodeAt("@akairo_no_sora",1)
+
*strData15.charCodeAt("@akairo_no_sora",1)
  
  
420行: 420行:
 
*第一引数:変換したい文字を含む文字列
 
*第一引数:変換したい文字を含む文字列
 
*第二引数:ISO Latein-1に変換したい文字のポジション
 
*第二引数:ISO Latein-1に変換したい文字のポジション
 +
 +
 +
 +
サンプルスクリプト
 +
<syntaxhighlight lang="javascript" line start="1">
 +
strData15 = new String("@akairo_no_sora");
 +
 +
document.write(strData15, " ,文字コード変換 ->");
 +
for(n = 1;n <= strData15.length;n++){
 +
    document.write(strData15.charCodeAt(strData15,n), ", ");
 +
}
 +
document.write("</BR>");
 +
 +
</syntaxhighlight>
 +
 +
 +
表示結果:
 +
 +
<yjavascript>
 +
strData15 = new String("@akairo_no_sora");
 +
 +
document.write(strData15, " ,文字コード変換 ->");
 +
for(n = 1;n <= strData15.length;n++){
 +
    document.write(strData15.charCodeAt(strData15,n), ", ");
 +
}
 +
document.write("</BR>");
 +
</yjavascript>
  
 
== '''文字コード変換(ISO Latin-1コード→文字列) fromCharCode ''' ==
 
== '''文字コード変換(ISO Latin-1コード→文字列) fromCharCode ''' ==

2016年7月20日 (水) 00:00時点における版



個人用ツール
名前空間

変種
操作
案内
ツールボックス