JavaScript Reference/Javascript Objects/String — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:22, 26 мая 2010
Содержание
"String" Example
<html>
<body>
<div id="myDiv" style="width:100; height:100;">This is some sample text</div>
<script language="javascript">
function function1(){
var temp = new String(); temp = myDiv.innerText; alert(temp);
}
</script>
<button onclick="function1();">String function</button>
</body>
</html>
"String" JavaScript Methods
+----------------+--------------------------------------------------------------+
| JavaScript |anchor big |
| Methods |blink bold |
| |charAt charCodeAt |
| |concat fixed |
| |fontColor fontSize |
| |fromCharCode indexOf |
| |italics lastIndexOf |
| |link localeCompare |
| |match replace |
| |search slice |
| |small split |
| |strike sub |
| |substr substring |
| |sup toLocaleLowerCase |
| |toLocaleUpperCase toLowerCase |
| |toSource toUpperCase |
| |valueOf |
+----------------+--------------------------------------------------------------+
"String" JavaScript Properties
+----------------+--------------------------------------------------------------+
| JavaScript |constructor length |
+----------------+--------------------------------------------------------------+
"String" Syntax and Note
Note:
Manipulate a string.
Syntax:
var stringName = new String("value") // value is any string
stringName.memberName