JustPaste.it

{
"repeat": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "Number",
"name": "times",
"fun": "How many times the string repeats"
}
},
"description": "Repeat a String",
"returns": "String",
"doc": {
"mainText": "With this function you can easily repeat a string as many times as needed.",
"examples": {
"1": {
"exampleText": "Lets Say we have the following JavaScript",
"example": '$$.string(".").repeat(15)',
"description": 'In this case, this would repeat the "." 15 times',
"ReturnText": "Returning",
"returns": "..............."
}
}
}
},
"between": {
"usefor": "Number", "version": "1.0",
"argument": {
"1": {
"type": "Number",
"name": "from",
"fun": "Starts the Range"
},
"2": {
"type": "Number",
"name": "to",
"fun": "Ends the Range"
}
},
"description": "Checks wheater the number is between a certain range",
"returns": "Boolean",
"doc": {
"mainText": "There might be a point when you will need to check for a number in a certain range. This function can do exactly that.",
"examples": {
"1": {
"exampleText": "For example",
"example": "$$.number(23).between(21,45)",
"description": "If 23 is between 21 and 45 than this will return true.",
"ReturnText": "Returns",
"returns": "true"
}
}
}
},
"extract": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String or RegExp",
"name": "pattern",
"fun": "Pattern to extract"
},
"2": {
"type": "Number",
"name": "startAt",
"optional": true,
"fun": "Start at a different part of a stinrg"
}
},
"description": "Extract Certain parts of a string",
"returns": "Array",
"doc": {
"mainText": "Taking data out of a string and put it into an array might seem difficult but not with this function.",
"examples": {
"1": {
"exampleText": "Lets check out this example",
"example": "$$.string('Add @tony, and @william in the system').extract(/\@(.+)/)",
"description": "What we are trying to archieve here is extract word that whats with @.",
"ReturnText": "Returns",
"returns": "['@tony','@william']"
},
"2": {
"exampleText": "But what if we just want to get the names without the @ ?<br> This is simple using the substr argument",
"example": "$$.string('Add @tony, and @william in the system').extract(/\@(.+)/,1)",
"description": "This would skip 1 character.",
"ReturnText": "Returning",
"returns": "['tony','william']"
}
}
}
},
"map": {
"usefor": "Array", "version": "1.0",
"argument": {
"1": {
"type": "Function",
"name": "fn",
"fun": "Function that will hold the test."
}
},
"description": "Run a function on every item of the array and store the new item made in a seperate array.",
"returns": "Array",
"doc": {
"mainText": "You can run a test on each item of the array.",
"examples": {
"1": {
"exampleText": "Using Map",
"example": "[1,4,9,16,25].map(Math.sqrt);",
"description": "This is just to demonstrate that built in functions are also alllowed.",
"ReturnText": "Returns",
"returns": "[1,2,3,4,5]"
},
"2": {
"exampleText": "Let try this same function but with our own function. <br> Like",
"example": "[1,2,3,4,5].map(function(me){ return me.toString(); });",
"description": "What we are trying to do here is turn each Number into a String.",
"ReturnText": "Returning",
"returns": '["1","2","3","4","5"]'
}
}
}
},
"blank": {
"usefor": "String", "version": "1.0",
"argument": false,
"description": "Check if a String is blank",
"returns": "Boolean",
"doc": {
"mainText": "If you need to check if a string is blank then feel free using this simple little function.",
"examples": {
"1": {
"exampleText": "Example",
"example": '$$.string(" ").blank()',
"description": "Even though there are more then one spaces in this string it is still blank.",
"ReturnText": "Returns",
"returns": "true"
}
}
}
},
"empty": {
"usefor": "Array", "version": "1.0",
"argument": false,
"description": "Empty an Array",
"returns": "Boolean",
"doc": {
"mainText": "Empty an array",
"examples": {
"1": {
"exampleText": "You can use",
"example": "[1,2,3,4,5].empty()",
"description": "",
"ReturnText": "Returns",
"returns": "[]"
}
}
}
},
"strip": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String or RegExp",
"name": "toStrip",
"fun": "This is the text you will strip"
},
"2": {
"type": "Boolean",
"name": "all",
"optional": true,
"fun": "If using a regular string to strip, you can stop it from replacing every match."
}
},
"description": "Strip Text from a String",
"returns": "String",
"doc": {
"mainText": "Taking text of a string would usually require you to use the replace function. But we simplified everything with the strip functions.",
"examples": {
"1": {
"exampleText": "Example",
"example": '$$.string("I need a car").strip(/\\w{3}/g)',
"description": "This would strip every word longer then 2 characters. So it would strip \"need\" and \"car\"",
"ReturnText": "Returning",
"returns": "I a"
},
"2": {
"exampleText": "That was an example using RegExp, but not everyone is exactly a fan of RegExp. <br>You can also use strings",
"example": '$$.string("I need a car car").strip("car")',
"description": "When using strings they will automatically strip all instances.",
"ReturnText": "Returning",
"returns": "I need a"
},
"3": {
"exampleText": "You might not always want to strip all. Change the all argument to false to only replace first instance",
"example": '$$.string("I need a car car").strip("car", false)',
"description": "This should now only strip the first \"car\".",
"ReturnText": "Returning",
"returns": "I need a car"
}
}
}
},
"precentOf": {
"usefor": "Number", "version": "1.0",
"argument": {
"1": {
"type": "Number",
"name": "number",
"fun": "Number you are trying to find the precent of."
}
},
"description": "Get the precent of a number.",
"returns": "Number",
"doc": {
"mainText": "Get the precent of a number using the precentOf() function.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.number(20).precentOf(100)",
"description": "This would get 20 precent of 100",
"ReturnText": "Which would return",
"returns": "20"
}
}
}
},
"contains": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String or Array",
"name": "contains",
"fun": "These will be the item(s) that you are checking for."
}
},
"description": "Check wheater a string contains the given item(s).",
"returns": "Boolean",
"doc": {
"mainText": "With this function you can determine if an item is inside of the string.",
"examples": {
"1": {
"exampleText": "Example",
"example": '$$.string("How are you").contains("Hello")',
"description": "We are trying to check if Hello is inside of the string.",
"ReturnText": "Returns",
"returns": "false"
}
}
}
},
"toNeg": {
"usefor": "Number", "version": "1.0",
"argument": false,
"description": "Turn a positive number to a negative.",
"returns": "Number",
"doc": {
"mainText": "Turn a positive number (+) to a negative (-)",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.number(13).toNeg()",
"description": "We are turning 13 to a negative (-13)",
"ReturnText": "Returning",
"returns": "-13"
}
}
}
},
"randomize": {
"usefor": "Array", "version": "1.0",
"argument": false,
"description": "Randomly Arrange an Array.",
"returns": "Array",
"doc": {
"mainText": "Setup an array randomly. Placing every item randomly on a new spot.",
"examples": {
"1": {
"exampleText": "For Example",
"example": "[1,2,3,4,5].randomize()",
"description": "",
"ReturnText": "Could Return",
"returns": "[2,1,5,4,3]"
}
}
}
},
"combine": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "itemA...itemZ",
"fun": "Number you are trying to find the precent of."
}
},
"description": "Combine 2 or more strings.",
"returns": "String",
"doc": {
"mainText": "This is actually already a built in function, concat. I decided that I don't like that name. So I just created my own function to combine 2 or more strings",
"examples": {
"1": {
"exampleText": "Example",
"example": '$$.string("How").combine("are","you")',
"description": "We are combining 3 strings together.",
"ReturnText": "Returns",
"returns": "Howareyou"
}
}
}
},
"filter": {
"usefor": "Array", "version": "1.0",
"argument": {
"1": {
"type": "Function",
"name": "fn",
"fun": "Function where you define test for each item in the array."
}
},
"description": "Test each item and only add it to the new array if it returns true.",
"returns": "Array",
"doc": {
"mainText": "Test each item with a true or false test that you execute inside of the function.",
"examples": {
"1": {
"exampleText": "Example",
"example": "[43,21,12,3,23].filter(function(item){ return item > 15 });",
"description": "If the item is greater than 15 then it will be returned in the new array",
"ReturnText": "This would return",
"returns": "[43,21,23]"
}
}
}
},
"inArray": {
"usefor": "Array", "version": "1.0",
"argument": {
"1": {
"type": "String or Array or Number",
"name": "contains",
"fun": "These are the items you are looking for."
},
"2": {
"type": "Boolean",
"name": "exact",
"optional": true,
"fun": "Find an exact match."
}
},
"description": "Check wheater the given item(s) is/are in the array.",
"returns": "Boolean",
"doc": {
"mainText": "Many times you will get user input and have to compare it to and array and see if they gave an item that is inside of the array. That is easy with this function.",
"examples": {
"1": {
"exampleText": "Example",
"example": "[1,2,3,4,5].inArray('1')",
"description": "Even though we are looking for a string ('1'). It will read it as a number since we aren't using the exact argument",
"ReturnText": "Returning",
"returns": "true"
},
"1": {
"exampleText": "To Stop the function from using '1' as a number we will need to add the second argument and give it the value, true<br>Example",
"example": "[1,2,3,4,5].inArray('1', true)",
"description": "Now it will not take '1' as a number",
"ReturnText": "Returning",
"returns": "false"
}
}
}
},
"trimIt": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "side",
"optional": true,
"fun": "Select a side to trip."
}
},
"description": "Trim a string.",
"returns": "String",
"doc": {
"mainText": "Trim a string with this function. You can even select if you want to strip on a certain side.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(' Hi ').trim()",
"description": "This will trim all the space in front and behind \"Hi\", leaving just \"Hi\"",
"ReturnText": "Returns",
"returns": "Hi"
},
"2": {
"exampleText": "Removing the space from either side can also be done<br>Example",
"example": "$$.string(' Hi ').trim('right')",
"description": "Setting the argument (side) to \"right\" would only trim the right side.",
"ReturnText": "Returns",
"returns": " Hi"
}
}
}
},
"extractScripts": {
"usefor": "String", "version": "1.0",
"argument": false,
"description": "Extract each script inside of the string and put into 1 array.",
"returns": "Array",
"doc": {
"mainText": "Simply extract the scripts in the string and put them into an array.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"<script>1+1</scr"+"ipt> how are you\")",
"description": "",
"ReturnText": "Returns",
"returns": "['1+1']"
}
}
}
},
"toPos": {
"usefor": "Number", "version": "1.0",
"argument": false,
"description": "Turn a negative number to positive.",
"returns": "Number",
"doc": {
"mainText": "Turn a negative (-) number to positive",
"examples": {
"1": {
"exampleText": "For Example",
"example": "$$.number(-13).toPos()",
"description": "",
"ReturnText": "Would Return",
"returns": "13"
}
}
}
},
"wrap": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "what",
"fun": "Text inside of the string that we are wrapping"
},
"2": {
"type": "Function",
"name": "with",
"fun": "Function we will need to wrap the text"
}
},
"description": "Wrap a part of a string.",
"returns": "String",
"doc": {
"mainText": "Wrap the desired part of the string with the desired text.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"How are you?\").wrap('How', function(item){ return '['+item+']' });",
"description": "This would wrap \"How\" with brackets.",
"ReturnText": "Returns",
"returns": "[How] are you?"
}
}
}
},
"makeReadable": {
"usefor": "Number", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "Spacer",
"optional": true,
"fun": "Number you are trying to find the precent of."
}
},
"description": "Format a number with the given spacer.",
"returns": "String",
"doc": {
"mainText": "When displaying numbers on a page you might just not want plain numbers. You might wanna format it a little better.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.number(1234566).makeReadable()",
"description": "This should add 2 commas throughout the number",
"ReturnText": "Returning",
"returns": "1,234,566"
}
}
}
},
"found": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "RegExp",
"name": "pattern",
"fun": "Pattern to be found"
},
"2": {
"type": "Number",
"name": "scaler",
"fun": "Change the scaler. Set to 1 if you want the whole match."
}
},
"description": "Return an array of all of the found match with the pattern.",
"returns": "Array",
"doc": {
"mainText": "Get all of the found matches of a pattern.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"Your old are you.\").found(/\w{3}/, 1)",
"description": "Finds all of the 3 letter words.",
"ReturnText": "Returning",
"returns": "['old','are','you']"
}
}
}
},
"swap": {
"usefor": "Array", "version": "1.0",
"argument": {
"1": {
"type": "String or Number",
"name": "firstItem",
"fun": "First item for the swap."
},
"2": {
"type": "String or Number",
"name": "secondItem",
"fun": "Second item for the swap"
}
},
"description": "Swap two items of an array",
"returns": "Array",
"doc": {
"mainText": "Swap two items of an array.",
"examples": {
"1": {
"exampleText": "Example",
"example": "[1,2,3,4,5].swap(2,5)",
"description": "This will swap the item 2 and 5. ",
"ReturnText": "Return",
"returns": "[1,5,3,4,2]"
},
"2": {
"exampleText": "You can also use numbers, in the swap attributes, as index if the numbers given are not in the array.<br>For Example",
"example": "['Hey','Are','How','You'].swap(1,2)",
"description": "This will swap the item 'Are' ('index': 1) and 'How' ('index': 2). ",
"ReturnText": "Return",
"returns": "['Hey','How','Are','You']"
}
}
}
},
"reverseBy": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "by",
"optional": true,
"fun": "Change the way it reverses."
}
},
"description": "Reverse a String",
"returns": "String",
"doc": {
"mainText": "You can reverse a string using this function. In the by argument, you can choose if you want to reverse the whole thing (character) or just each word.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"How are you\").reverseBy()",
"description": "If there is no argument it will automatically reverse by character",
"ReturnText": "Returning",
"returns": "uoy era woH"
},
"2": {
"exampleText": "By Word",
"example": "$$.string(\"How are you\").reverseBy('word')",
"description": "Now we will reverse by word",
"ReturnText": "Returning",
"returns": "you are How"
}
}
}
},
"capitilize": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "part",
"optional": true,
"fun": "Select wheater you want to capitilize the whole thing, first letter, last letter, and the first letter of each word."
}
},
"description": "Capitilize a string.",
"returns": "String",
"doc": {
"mainText": "Capitilize a string.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"how are you\").capitilize()",
"description": "Since the part argument is empty the default option with be 'character'. This capitilizes all letters.",
"ReturnText": "Returning",
"returns": "HOW ARE YOU"
},
"2": {
"exampleText": "You can also use the 'word' option<br>For Example",
"example": "$$.string(\"how are you\").capitilize('word')",
"description": "This would capitilize the first letter of each word.",
"ReturnText": "Returning",
"returns": "How Are You"
},
"3": {
"exampleText": "Another useful option would be the 'first' option<br>For Example",
"example": "$$.string(\"how are you\").capitilize('first')",
"description": "This would capitilize the first letter of the string.",
"ReturnText": "Returning",
"returns": "How are you"
},
"4": {
"exampleText": "This last option, 'last' can also be useful<br>For Example",
"example": "$$.string(\"how are you\").capitilize('last')",
"description": "This would capitilize the last letter of the string. This would most likely be useful for reversed strings.",
"ReturnText": "Returning",
"returns": "how are yoU"
}
}
}
},
"readJSON": {
"usefor": "String", "version": "1.0",
"argument": false,
"description": "Read JSON and return an object with the JSON.",
"returns": "Object",
"doc": {
"mainText": "Read JSON",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string('{\"Hi\":\"Hello\"}')",
"description": "",
"ReturnText": "Returning",
"returns": "{'Hi': \"Hello\"}"
}
}
}
},
"isJSON": {
"usefor": "String", "version": "1.0",
"argument": false,
"description": "Check if the string is JSON.",
"returns": "Boolean",
"doc": {
"mainText": "Check if is the given string is JSON",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"{\"fdsd\"}32jds\").isJSON()",
"description": "This is obviously not JSON.",
"ReturnText": "So, this returns",
"returns": "false"
}
}
}
},
"update": {
"usefor": "Array", "version": "1.0",
"argument": {
"1": {
"type": "String or Number",
"name": "item",
"fun": "This is the item we want to change."
},
"2": {
"type": "String",
"name": "updateTo",
"fun": "This will be the new Item."
}
},
"description": "Update an item of an Array",
"returns": "Array",
"doc": {
"mainText": "You can easily change an item in an array with this function.",
"examples": {
"1": {
"exampleText": "Example",
"example": "[1,2,3,4,5].update(1,4)",
"description": "This updates the item 1 and replaces it with 4",
"ReturnText": "Returning",
"returns": "[4,2,3,4,5]"
},
"2": {
"exampleText": "You can also use the index in the item argument if the number isnt in the array<br>For Example",
"example": "[\"1\",\"2\",\"3\",\"4\",\"5\"].update(0,\"4\")",
"description": "This updates \"1\" ('index': 0) and replaces it with 4",
"ReturnText": "Returning",
"returns": "[\"4\",\"2\",\"3\",\"4\",\"5\"]"
}
}
}
},
"toOrdinals": {
"usefor": "Number", "version": "1.0",
"argument": false,
"description": "Turn a number to its ordinal.",
"returns": "String",
"doc": {
"mainText": "When displaying numbers of a page you might want to display it in a more \"pretty\" way",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.number(123).toOrdinals()",
"description": "",
"ReturnText": "Returns",
"returns": "123rd"
}
}
}
},
"pushAfter": {
"usefor": "Array", "version": "1.0",
"argument": {
"1": {
"type": "String or Array",
"name": "push",
"fun": "This is/are the item(s) we are typing to push to the array."
},
"2": {
"type": "String or Number",
"name": "After",
"optional": true,
"fun": "This the item of the array where you wish the push the given item(s) after."
},
"3": {
"type": "Number",
"name": "delete",
"optional": true,
"fun": "Delete a number about of items after the pushed ones."
}
},
"description": "Push an item after the disired one. You can also delete the given amount of items after the added items.",
"returns": "Number",
"doc": {
"mainText": "Sometimes you will not need to just push an item to the end of an array but also to the center, or the beginning. You can do that with this function. ",
"examples": {
"1": {
"exampleText": "Example",
"example": "['Hi','Hello'].pushAfter(\"Bye\",'Hi')",
"description": "This pushes \"Bye\" after \"Hi\". This function returns the new lenght of the array",
"ReturnText": "Returning",
"returns": "3 //The new array would be ['Hi','Bye','Hello']"
},
"2": {
"exampleText": "You can also push multiple items<br>Example",
"example": "['Hi','Hello'].pushAfter([\"Bye\",\"Yo\"],'Hi')",
"description": "This pushes \"Bye\" and \"Yo\" after \"Hi\".",
"ReturnText": "Returning",
"returns": "4 //The new array would be ['Hi','Bye','Yo','Hello']"
},
"3": {
"exampleText": "We can also delete a given amount of items after the pushed items.<br>Example",
"example": "['Hi','Hello'].pushAfter([\"Bye\",\"Yo\"],'Hi', 1)",
"description": "This pushes \"Bye\" and \"Yo\" after \"Hi\" and deletes 1 item after the last item pushed (Yo)",
"ReturnText": "Returning",
"returns": "3 //The new array would be ['Hi','Bye','Yo']"
},
"4": {
"exampleText": "You can also just simple push an item to the array like you usually would.<br>Example",
"example": "['Hi','Hello'].pushAfter(\"Hey\")",
"description": "This pushes \"Hey\" to the end of the array.",
"ReturnText": "Returning",
"returns": "3 //The new array would be ['Hi','Hello','Hey']"
}
}
}
},
"rand": {
"usefor": "Number", "version": "1.0",
"argument": {
"1": {
"type": "Number",
"name": "max",
"optional": true,
"fun": "This is the max number for the range of random numbers.."
}
},
"description": "Return a random number",
"returns": "Number",
"doc": {
"mainText": "Return a random number",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.number(2).rand(32)",
"description": "This would display a random number from 2 to 32. Note, if the max argument is empty then the max will automatically be the max 16 bit number possible (2147483647)",
"ReturnText": "Could Return",
"returns": (Math.floor(Math.random() * (32 - 2 + 1)) + 2)
}
}
}
},
"each": {
"usefor": "Array", "version": "1.0",
"argument": {
"1": {
"type": "Function",
"name": "fn",
"fun": "This is the function your want to run on each item of the array."
}
},
"description": "Run a function on each item of the array.",
"returns": "No Return",
"doc": {
"mainText": "Run a function on each item. The each function doesn't return anything.",
"examples": {
"1": {
"exampleText": "Example",
"example": "[\"1\",\"2\",\"3\",\"4\",\"5\"].each(function(item, index, array){ alert('This is item #:'+index+' My value is'+item+' I come from'+array) });",
"description": "This would alert for each item.",
"ReturnText": "Returns",
"returns": "undefined //nothing actually being returned"
}
}
}
},
"replaceWith": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "new",
"fun": "This will be the new string."
}
},
"description": "Replace a string with another.",
"returns": "String",
"doc": {
"mainText": "Replace a string with another.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"How are you?\").replaceWith(\"Why?\")",
"description": "This will replace that whole string with \"Why?\"",
"ReturnText": "Returning",
"returns": "Why?"
}
}
}
},
"precision": {
"usefor": "Number", "version": "1.0",
"argument": {
"1": {
"type": "Number",
"name": "deci",
"fun": "The length of the decimals."
}
},
"description": "Create specific length for the fractional-part of a number (numbers behind decimal point).",
"returns": "Number",
"doc": {
"mainText": "Create specific length for the fractional-part of a number (numbers behind decimal point).",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.number(2.3442).precision(2)",
"description": "This would change the length of the fractional-part of the number to 2",
"ReturnText": "Returning",
"returns": "2.34"
}
}
}
},
"REMOVE": {
"usefor": "Array", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "itemA...itemZ",
"fun": "These/This will be the item(s) you are removing from the Array."
}
},
"description": "Remove 1 or more items from an array",
"returns": "Array",
"doc": {
"mainText": "This is a very useful function remove 1 or more items from an array.",
"examples": {
"1": {
"exampleText": "Example",
"example": "[1,2,3,4,5].remove(1,2,5)",
"description": "This would remove 1, 2, and 5",
"ReturnText": "Returning",
"returns": "[3,4]"
}
}
}
},
"RANDOMIZE": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "Boolean",
"name": "spaces",
"optional": true,
"fun": "If set to true, remove all of the spaces between words."
}
},
"description": "Randomly arrange a string.",
"returns": "String",
"doc": {
"mainText": "Believe it or not, making this function was tricky. But its useful if you are trying to generate a random key for users.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"How are you\").randomize()",
"description": "",
"ReturnText": "Could Return",
"returns": "a wHryoo eu"
},
"2": {
"exampleText": "If you are trying to make a random key with even words you wont want the spaces so you can set \"spaces\" to false <br> Example",
"example": "$$.string(\"How are you\").randomize(true)",
"description": "",
"ReturnText": "Could Return",
"returns": "wruoHeayo"
}
}
}
},
"isPos": {
"usefor": "Number", "version": "1.0",
"argument": false,
"description": "Check if a number is positive.",
"returns": "Boolean",
"doc": {
"mainText": "Check if a number is positive",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.number(-12)",
"description": "This checks if -12 is positive.",
"ReturnText": "Returning",
"returns": "false"
}
}
}
},
"getQuery": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "divide",
"fun": 'Change the character where we start reading the Query. For example, the current one "is": "?"'
}
},
"description": "Get the Query of a url.",
"returns": "Object",
"doc": {
"mainText": "Getting the Query of a url without PHP might seem impossible. But with function you easily do this meaning you can get information from the url without PHP",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"'http': //example.com?id=11\").getQuery()",
"description": "This will get the query and put it into an object",
"ReturnText": "Returning",
"returns": "{'id': 11}"
},
"2": {
"exampleText": "You can also change the way you get your query so if you want to use a hash tag instead you can.<br>Example",
"example": "$$.string(\"'http': //example.com#id=11\").getQuery('#')",
"description": "This will get the query in the hashtag.",
"ReturnText": "Returning",
"returns": "{'id': 11}"
},
}
}
},
"remove": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String or Array",
"name": "item(s)",
"fun": "Item(s) to remove from the string"
}
},
"description": "Remove 1 or more items from a String.",
"returns": "String",
"doc": {
"mainText": "Remove 1 or more items from a String.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"Hi\").remove(\"i\")",
"description": "",
"ReturnText": "Returning",
"returns": "H"
}
}
}
},
"collapseSpaces": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "Number",
"name": "allow",
"optional": true,
"fun": "Allow a certain amount of spaces."
}
},
"description": "Turn more than one space, or the given length back to a single space.",
"returns": "String",
"doc": {
"mainText": "Now you can not only trim a string but you can also remove multiple spaces between words and turn it back into a single space.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"How are you?\").collapseSpaces()",
"description": "",
"ReturnText": "Returns",
"returns": "How are you?"
},
"2": {
"exampleText": "You can also set a limit to when it will convert it back to a single space so if you want to allow 2 spaces you can. <br>Example",
"example": "$$.string(\"How are you?\").collapseSpaces(2)",
"description": "These spaces wont go back to a single space since it is only 2. And in the allow argument we said 2 are still allowed",
"ReturnText": "Returning",
"returns": "How are you?"
}
}
}
},
"camelize": {
"usefor": "String", "version": "1.0",
"argument": false,
"description": "Converts a string separated by dashes and/or underscores into a camelCase equivalent.",
"returns": "String",
"doc": {
"mainText": "Converts a string separated by dashes and/or underscores into a camelCase equivalent.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"java-script\").camelize()",
"description": "",
"ReturnText": "Returns",
"returns": "javaScript"
}
}
}
},
"html": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "option",
"fun": "Change what you are trying to do to the HTML"
}
},
"description": "Do a number of actions to HTML in a string.",
"returns": "String",
"doc": {
"mainText": "With this function you can, escape, unescape, and strip html. You just change the option argument 'to': escape, unescape, or strip",
"examples": {
"1": {
"exampleText": "For Example",
"example": "$$.string(\"<div class=\"text\">Hi</div>\").html(\"escape\")",
"description": "Since we set the option to escape, thats exactly what this would do.",
"ReturnText": "Returning",
"returns": "&lt;div class=\"text\"&gt;Hi&lt;/div&gt;"
}
}
}
},
"isNeg": {
"usefor": "Number", "version": "1.0",
"argument": false,
"description": "Check if a number is negative.",
"returns": "Boolean",
"doc": {
"mainText": "Check if a number is negative.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.number(33).isNeg()",
"description": "",
"ReturnText": "Returns",
"returns": "false"
}
}
}
},
"count": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "toCount",
"fun": "The string you are trying to count."
}
},
"description": "Counts how many times an item is found in a string.",
"returns": "Number",
"doc": {
"mainText": "BLAH BLAH",
"examples": {
"1": {
"exampleText": "Example",
"example": "//Code",
"description": "WHAT IT DOES",
"ReturnText": "Returns",
"returns": "//Code"
}
}
}
},
"getIndexOf": {
"usefor": "Array", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "item",
"fun": "Item we are trying to get the index of"
}
},
"description": "Get the index of an item in an array.",
"returns": "Number",
"doc": {
"mainText": "I created this function because at the time methods.js was under pre development I actually forgot that javascript has the built in indexOf function. I considered that I will keep this function though since I just didn't want to delete it.",
"examples": {
"1": {
"exampleText": "Example",
"example": "['hi','ji','hu','hr'].getIndexOf('ji')",
"description": "",
"ReturnText": "Returns",
"returns": "1"
}
}
}
},
"shorten": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "Number",
"name": "length",
"fun": "The Length of the shortened string (without omissionText)"
},
"2": {
"type": "String",
"name": "omissionText",
"fun": "The text that will be added to the end of the shortened string."
}
},
"description": "Shorten a String.",
"returns": "String",
"doc": {
"mainText": "Shorten a String to the given length. With this function you can easily create a truncate system.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"How did you do that without tools?\").shorten(10)",
"description": "This will will change the length of the string to 10 + the omission text",
"ReturnText": "Returning",
"returns": "How did yo..."
},
"2": {
"exampleText": "You can also change the omission text.<br>For Example",
"example": "$$.string(\"How did you do that without tools?\").shorten(10, ' [...]')",
"description": "This will will change the length of the string to 10 + the omission text which was changed to \" [...]\"",
"ReturnText": "Returning",
"returns": "How did yo [...]"
}
}
}
},
"replaceAll": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "find",
"fun": "This is the string we are looking for"
},
"2": {
"type": "String or Function",
"name": "replace",
"fun": "The text we will replace the found items with"
},
"3": {
"type": "String",
"name": "flags",
"optional": true,
"fun": "Change the flag for the RegExp inside of the code."
}
},
"description": "Searches for a match and replaces all found.",
"returns": "String",
"doc": {
"mainText": "Lots of programming languages are missing this one little feature. Replacing all of the matches.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"Hey Hey! How are you?\").replaceAll(\"Hey\",\"\")",
"description": "This would replace both Hey's with nothing.",
"ReturnText": "Returning",
"returns": " ! How are you?"
},
"2": {
"exampleText": "You can also change the RegExp flags.<br>For Example",
"example": "$$.string(\"Hey hey! How are you?\").replaceAll(\"hey\",\"\",'i')",
"description": "This would replace both Hey's with nothing since we added the \"i\" flag which will make it case insensitive.",
"ReturnText": "Returning",
"returns": " ! How are you?"
}
}
}
},
"evalScripts": {
"usefor": "String", "version": "1.0",
"argument": false,
"description": "Extract each script inside of the string, eval it, and put it into an array.",
"returns": "Array",
"doc": {
"mainText": "Simply extract the scripts in the string, eval them, and put them into an array.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"<script>1+1</scr"+"ipt> how are you\")",
"description": "",
"ReturnText": "Returns",
"returns": "['2']"
}
}
}
},
"dashify": {
"usefor": "String", "version": "1.0",
"argument": false,
"description": "Replace all of the underscores with dashes.",
"returns": "String",
"doc": {
"mainText": "Replace all of the underscores with dashes.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"java_script\").dashify()",
"description": "",
"ReturnText": "Returns",
"returns": "java-script"
}
}
}
},
"isZero": {
"usefor": "Number", "version": "1.0",
"argument": false,
"description": "Check if a number is Zero.",
"returns": "Boolean",
"doc": {
"mainText": "Check if a number is Zero",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.number(0).isZero()",
"description": "",
"ReturnText": "Returns",
"returns": "true"
}
}
}
},
"listToArray": {
"usefor": "String", "version": "1.0",
"argument": false,
"description": "Extract the lists out of an array. Each list will be stored in a different part of the array but each item of the list will also be in a seperate array.",
"returns": "Array",
"doc": {
"mainText": "Extract Lists out of an array and sort them into an array too.",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"We need to 'get': pizza,ice cream,pie but then we will also need bread,cake,butter\").listToArray()",
"description": "This will extract the boths lists in the string and put then in an array. Each item of the list will also go inside of the array for that list.",
"ReturnText": "Returns",
"returns": "[['pizza','ice crean','pie'],['bread','cake','butter']]"
}
}
}
},
"place": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "Object",
"name": "places",
"fun": "Items we will be places into the string"
}
},
"description": "Place items (variables, strings etc) into an array.",
"returns": "String",
"doc": {
"mainText": "You can now place variables inside a string with just one function. ",
"examples": {
"1": {
"exampleText": "For Example",
"example": "$$.string(\"We will need ${number} ${item}s!\").place({'number': 13, 'item': \"dog\"})",
"description": "You put the name of the objects key between ${ and } and then it will get the value.",
"ReturnText": "Returning",
"returns": "We will need 13 dogs!"
},
"2": {
"exampleText": "You can also use the argument way. I don't recommend it, but it works. <br>For Example",
"example": "$$.string(\"We will need ${1} ${2}s!\").place(13, 'dog')",
"description": "You just put the number of the argument between ${ and } to retrieve the information.",
"ReturnText": "Returning",
"returns": "We will need 13 dogs!"
}
}
}
},
"append": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "toAppend",
"fun": "What we are trying to append."
},
"2": {
"type": "String",
"name": "side",
"optional": true,
"fun": "Pick the side you want to append the string to."
}
},
"description": "Append a string to another",
"returns": "String",
"doc": {
"mainText": "Appending to a string, can be easy, but with a function, its even easier!",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"How are\").append(\" you\")",
"description": "This is the same as changing the side option to 'after'.",
"ReturnText": "Returning",
"returns": "How are you"
},
"2": {
"exampleText": "But you can also append text in front of a string. <br>Example",
"example": "$$.string(\"How are\").append(\"you \",'before')",
"description": "",
"ReturnText": "Returns",
"returns": "you How are"
}
}
}
},
"take": {
"usefor": "Array", "version": "1.0",
"argument": {
"1": {
"type": "Number",
"name": "from",
"fun": "Start the range."
},
"2": {
"type": "String",
"name": "to",
"optional": true,
"fun": "End the range"
}
},
"description": "Take items from an array between a certain range",
"returns": "Array",
"doc": {
"mainText": "Take items from an array between a certain range",
"examples": {
"1": {
"exampleText": "Example",
"example": "['Hi','Bye','Shoes','Pizza','Taker'].take(1,3)",
"description": "This would return the array from index 1, to 3",
"ReturnText": "Returning",
"returns": "['Bye','Shoes','Pizza']"
}
}
}
},
"startsWith": {
"usefor": "String", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "this",
"fun": "String to check."
}
},
"description": "Check if the string startsWith the given string (this).",
"returns": "Boolean",
"doc": {
"mainText": "Check if the string startsWith the given string (this).",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"This is cool!\").startsWith(\"\")",
"description": "This will check if the string startsWtih \"\"",
"ReturnText": "Returns",
"returns": "false"
}
}
}
},
"endsWith": {
"usefor": "String", "version": "1.0", "version": "1.0",
"argument": {
"1": {
"type": "String",
"name": "this",
"fun": "String to check."
}
},
"description": "Check if the string endWith the given string (this).",
"returns": "Boolean",
"doc": {
"mainText": "Check if the string endsWith the given string (this).",
"examples": {
"1": {
"exampleText": "Example",
"example": "$$.string(\"This is cool!\").endsWith(\"\")",
"description": "This will check if the string endsWtih \"\"",
"ReturnText": "Returns",
"returns": "true"
}
}
}
}
}