using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; namespace Service.Common{ public static class StringExt { public static string JoinToString<T>(this IEnumerable<T> col…
1.字符串遍历接口 字符串可以被for...of循环遍历 'use strict'; for (let codePoint of 'foo') { //控制台输出f o o console.log(codePoint) } 2.include(),startsWith(),endsWith()方法 includes():返回布尔值,表示是否找到了参数字符串. startsWith():返回布尔值,表示参数字符串是否在原字符串的头部. endsWith():返回布尔值,表示参数字符串是否在原字符串…
模板字符串 传统写法 var str = 'There are <b>' + basket.count + '</b> ' + 'items in your basket, ' + '<em>' + basket.onSale + '</em> are on sale!' ES6写法 let str = ` There are <b>${basket.count}</b> items in your basket, <em>…