What is String Number Operation?
The String most often from the action + Operators. when one of its operators not a number. The easy way of getting the string that results from type-conversion is to concatenate a value to string. The alternative method of convert a value into a string to pass it is argument to the String constructor called as a function. Exam:-
|Var string Value= String(d);|
The Converting values to numbers especially to strings numbers, it is an extremely common requirement and many methods can be used. There are any mathematical operation except the concatenation addition operator will force type-conversion. So the conversion of a string to a number might entail performing a mathematical operation on the string representation of the number that would not affect the resulting number, such as subtracting zero or multiplying by one.
|var numValue = stringValue -
var numValue = stringValue * 1;
var numValue = stringValue / 1;
document.write('This is test'.charAt(10));
document.write('This program Test'.length);
document.write(' program'.substring(1, 10));
document.write('my exam Test'.substr(7, 10));
Array is the basically just a list of items. Each item an array can be whatever you want, but they are usually related to one-another.
var students = ['amar', 'rani', 'vinod', 'susil','santosh'];
var suffixes = ['1st', '2nd', '3rd', '4th','5th'];
for(var i=0; i<=4; i++)
alert('The '+suffixes[i]+' student is '+students[i]);
The numbers is a central task for the many programs. In fact, the desire to automate number operations was the motivation that drove the invention of digital computers decades ago. we will learn how to work with numbers in Java, including arithmetic, conversions, and other numeric operations.
var sum = 10 + 10;
sub = 15 - 5;
mul = 25 * 5; //multiplication
divided = 30 / 5;
modulus = 10 % 10; //modulus division
If you enjoyed this post then why not add us on Google+? Add us to your Circles
Liked it! Share this Tutorial