Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

array.convertall

//Double each value in an array using Array.ConvertAll();

using System;
public class Kata
{
  public static int[] DoubleTheArrayElements(int[] arr)
  {
    return Array.ConvertAll(arr, element => element * 2);
  } 
}

// could also just be done with LINQ like this:
return arr.Select(x => x * 2);
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# string is not null or empty 
Csharp :: c# list append 
Csharp :: varibles c# 
Csharp :: .net mvc c# alert to client browswer window 
Csharp :: c# linq remove duplicate items from list of integer 
Csharp :: unity random 
Csharp :: generate random name c# 
Csharp :: c# rsa example 
Csharp :: casting string to enum type 
Csharp :: c# how to refreshyour bindingsource 
Csharp :: unity position localposition 
Csharp :: making a gui that can only be visible by owner roblox 
Csharp :: how to loop over array in c# 
Csharp :: call stored proc c# 
Csharp :: c# get all the column names from datagridview 
Csharp :: loop through string array c# 
Csharp :: c# dictionary loop key value 
Csharp :: how to make an object move in unity 
Csharp :: dotnet new project 
Csharp :: c# remove duplicates from datatable 
Csharp :: dota2 
Csharp :: c# unity detect any keyboard input but not mouse input 
Csharp :: dotnet build command 
Csharp :: serilog minimum log level 
Csharp :: system.io.directorynotfoundexception c# 
Csharp :: unity pick random number 
Csharp :: asp.net file detect mime type 
Csharp :: decimal c# 2 digits 
Csharp :: gameobject on click unity 
Csharp :: callback function on animation end unity 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =