日期:2014-05-17 浏览次数:21172 次
var value = Regex.Matches("IBM发布基于人脑特性设计的全新计算架构和编程语言", @"\w{5}");
using System;
public class SubStringTest
{
public static void Main()
{
string[] info = { "Name: Felica Walker", "Title: Mz.", "Age: 47", "Location: Paris", "Gender: F" };
int found = 0;
Console.WriteLine("The initial values in the array are:");
foreach (string s in info)
Console.WriteLine(s);
Console.WriteLine("{0}We want to retrieve only the key information. That is:", Environment.NewLine);
foreach (string s in info)
{
found = s.IndexOf(":");
Console.WriteLine(s.Substring(found + 1).Trim());
}
}
}
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections;
using System.Text.RegularExpressions;
namespace cop
{
class HelloWorld