What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-06 00:30:47
convert rgb value in hexadecimal system
function convertRgb(rgb) { // This will choose the correct separator, if there is a "," in your value it will use a comma, otherwise, a separator will not be used. var separator = rgb.indexOf(",") > -1 ? "," : &quo... Add solution -
C# 2022-03-03 11:15:21
sum array c#
int[] arr = new int[] { 1, 2, 3 }; int sum = 0; for (int i = 0; i < arr.Length; i++) { sum += arr[i]; } int[] arr = { 3, 6, 4, 1, 6, 8 }; // returns 1 Array.IndexOf(arr, 6); int maxValue = anArray.Max(); int maxIndex = anArray.ToList().IndexOf(m... Add solution -
Javascript 2022-02-28 23:00:04
how to delete the array in javascript
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-02-28 19:35:03
javascript get browser name
//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 -
Javascript 2022-02-27 05:40:22
8.3.1. Common Array Methods // indexOf Examples (.indexOf)
//The general syntax for this method is: arrayName.indexOf(item) /*This method returns the index of the FIRST occurence of an item in the array. If the item is not in the array, -1 is returned.*/ let charles = [1, 7, 5, 9, 5]; let otherArray = ['hello',... Add solution -
Javascript 2022-02-24 17:40:25
if cookie exists javascript
//You can call the function getCookie with the name of the cookie you want, then check to see if it is = null. function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + pre... Add solution -
C# 2022-02-20 02:20:05
c# wpf kill processes by username
using System.Security.Principal; using System.Runtime.InteropServices; public class ProcessManager { public static void KillProcessByNameAndUserName(string processName, string userName) { var processes = from p in Process.GetProcessesByName... Add solution