What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-06 16:10:31
.index of javascript
//indexOf getting index of array element, returns -1 if not found var colors=["red","green","blue"]; var pos=colors.indexOf("blue");//2 //indexOf getting index of sub string, returns -1 if not found var str = "... Add solution -
C# 2022-02-06 00:50:41
encrypption in C# console using mod of 26
namespace CaesarCipher { class Program { static void Main(string[] args) { // Determining if user wants to encrypt or decrypt. Console.WriteLine("Chose One: Encrypt / Decrypt"); string encryptDecrypt = Console.ReadL... Add solution -
Javascript 2022-02-02 21:05:25
how to find and remove object from array in javascript
// we have an array of objects, we want to remove one object using only the id property var apps = [{id:34,name:'My App',another:'thing'},{id:37,name:'My New App',another:'things'}]; // get index of object with id:37 var removeIndex = apps.map(function... Add solution -
C# 2022-02-01 07:11:50
modificare una strinfa in c#
string phrase = "The quick brown fox jumps over the fence"; Console.WriteLine(phrase); char[] phraseAsChars = phrase.ToCharArray(); int animalIndex = phrase.IndexOf("fox"); if (animalIndex != -1) { phraseAsChars[animalIndex++] = '... Add solution -
Javascript 2022-02-01 04:35:29
how to delete an element from an array
var colors = ["red","blue","car","green"]; var carIndex = colors.indexOf("car");//get "car" index //remove car from the colors array colors.splice(carIndex, 1); // colors = ["red",&... Add solution -
Javascript 2022-01-31 03:26:30
detect user browser javascript
//gets the type of browser function detectBrowser() { if((navigator.userAgent.indexOf("Opera") || navigator.userAgent.indexOf('OPR')) != -1 ) { return 'Opera'; } else if(navigator.userAgent.indexOf("Chrome") != -1 ... Add solution