1
0
Fork 0
forked from 0x2620/oxjs

add missing functionality to Ox.api (positions requests and enums)

This commit is contained in:
rlx 2012-03-29 18:40:03 +00:00
commit f3ff4b791d
2 changed files with 164 additions and 42 deletions

View file

@ -46,6 +46,8 @@ Ox.endsWith <f> Checks if a string ends with a given substring
@*/
Ox.ends = Ox.endsWith = function(str, sub) {
// fixme: rename to ends
str = str.toString();
sub = sub.toString();
return str.substr(str.length - sub.length) == sub;
};
@ -427,6 +429,8 @@ Ox.startsWith <f> Checks if a string starts with a given substring
@*/
Ox.starts = Ox.startsWith = function(str, sub) {
// fixme: rename to starts
str = str.toString();
sub = sub.toString();
return str.substr(0, sub.length) == sub;
};