سلام بر تمامی برنامه نویسان عزیز 😉 در این مطلب کد linq: جمع کردن طول (Length) تمام اعضای آرایه رشته ای با متد Sum در سی شارپ #C را آماده کردم. امیدوارم که این کد برای شما مفید باشد.
کد linq: جمع کردن طول (Length) تمام اعضای آرایه رشته ای با متد Sum در سی شارپ #C :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class MainClass {
public static void Main() {
string[] words = { "cherry", "apple", "blueberry" };
double totalChars = words.Sum(w => w.Length);
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class MainClass {
public static void Main() {
string[] words = { "cherry", "apple", "blueberry" };
double totalChars = words.Sum(w => w.Length);