getting right 2 characters from a string 
Author Message
 getting right 2 characters from a string

Hopefully jscript is close enough to javascript.

How do I get the right two characters from a string?  Someone input's "2000"
I want to get "00"



Fri, 02 May 2003 03:00:00 GMT  
 getting right 2 characters from a string

Quote:

>How do I get the right two characters from a string?  Someone input's "2000"
>I want to get "00"

a combination of string.length and string.substr(from, to)

--
Andy Burns



Fri, 02 May 2003 03:00:00 GMT  
 getting right 2 characters from a string
var  s, i;

s = "2000";
i  = s.length;
s  = s.substring(i - 2, i);

Quote:

> Hopefully jscript is close enough to javascript.

> How do I get the right two characters from a string?  Someone input's "2000"
> I want to get "00"



Sat, 03 May 2003 14:00:12 GMT  
 getting right 2 characters from a string
Thanks a bunch.


Quote:
> Hopefully jscript is close enough to javascript.

> How do I get the right two characters from a string?  Someone input's
"2000"
> I want to get "00"



Sat, 03 May 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Character 15 gets changed to character 12: why?

2. getting query string from frame in jscript and getting frame name from another frame

3. Searching characters from the right

4. padding a string with spaces to the right

5. RegExp String-almost-right

6. String evaluation from right problem

7. Extract right part of a string

8. Getting number of characters with Length ?

9. Getting/setting character position in an input field

10. getting the path representation of a character to server stdout

11. Getting at character outlines

12. Remove last N characters from string

 

 
Powered by phpBB® Forum Software