我是c#编程的初学者.我正在接受错误The name 'File' does not exist in the current context.
问题必须在线 var v = File.ReadLines("dictionary.txt");
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication7
{
class Program
{
static void Main(string[] args)
{
if (args.Length > 0)
{
var v = File.ReadLines("dictionary.txt");
Run Code Online (Sandbox Code Playgroud) 我有一个字符串
var str = "14??? 7???? 12??? 7????";
Run Code Online (Sandbox Code Playgroud)
我需要在字符串中选择第一个数字(14,7,12,7).
我编写了以下代码的代码,但是这段代码选择了分开的数字(1,4,7,1,2,7):
for (var i = 0; i < str.length; i++) {
newStr = str.match(/\d/g);
}
Run Code Online (Sandbox Code Playgroud)