我的印度软件老师,给的 几个C# PROGRAMS (2)

原创 2005年05月23日 02:37:00

using System;
using System.Text.RegularExpressions;

namespace Wrox.ProCSharp.RegularExpressionPlayaround
{
   class MainEntryPoint
   {
      static void Main()
      {
         Find1();
         Console.ReadLine();
      }

      static void Find1()
      {
         string text = @"XML has made a major impact in almost every aspect of
            software development. Designed as an open, extensible, self-describing
            language, it has become the standard for data and document delivery on
            the web. The panoply of XML-related technologies continues to develop
            at breakneck speed, to enable validation, navigation, transformation,
            linking, querying, description, and messaging of data.";
         string pattern = @"/bn/S*ion/b";
         MatchCollection matches = Regex.Matches(text, pattern,
            RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace |
            RegexOptions.ExplicitCapture);
         WriteMatches(text, matches);
      }  

      static void Find2()
      {
         string text = @"XML has made a major impact in almost every aspect of
            software development. Designed as an open, extensible, self-describing
            language, it has become the standard for data and document delivery on
            the web. The panoply of XML-related technologies continues to develop
            at breakneck speed, to enable validation, navigation, transformation,
            linking, querying, description, and messaging of data.";
         string pattern = @"/bn";
         MatchCollection matches = Regex.Matches(text, pattern,
           RegexOptions.IgnoreCase);
         WriteMatches(text, matches);
      }

      static void WriteMatches(string text, MatchCollection matches)
      {
         Console.WriteLine("Original text was: /n/n" + text + "/n");
         Console.WriteLine("No. of matches: " + matches.Count);
         foreach (Match nextMatch in matches)
         {
            int Index = nextMatch.Index;
            string result = nextMatch.ToString();
            int charsBefore = (Index < 5) ? Index : 5;
            int fromEnd = text.Length - Index - result.Length;
            int charsAfter = (fromEnd < 5) ? fromEnd : 5;
            int charsToDisplay = charsBefore + charsAfter + result.Length;

            Console.WriteLine("Index: {0}, /tString: {1}, /t{2}",
               Index, result,
               text.Substring(Index - charsBefore, charsToDisplay));

         }
      }
   }
}

using System;
using System.Text;

namespace Wrox.ProCSharp.StringEncoder
{
   class MainEntryPoint
   {
      static void Main(string[] args)
      {
         string greetingText = "Hello from all the guys at Wrox Press. ";
         greetingText += "We do hope you enjoy this book as much as we enjoyed writing it.";

         for(int i = (int)'z'; i>=(int)'a' ; i--)
         {
            char Old = (char)i;
            char New = (char)(i+1);
            greetingText = greetingText.Replace(Old, New);
         }

         for(int i = (int)'Z'; i>=(int)'A' ; i--)
         {
            char Old = (char)i;
            char New = (char)(i+1);
            greetingText = greetingText.Replace(Old, New);
         }
         Console.WriteLine("Encoded:/n" + greetingText);

         StringBuilder greetingBuilder =
            new StringBuilder("Hello from all the guys at Wrox Press. ", 150);
         greetingBuilder.Append("We do hope you enjoy this book as much as we enjoyed writing it");

         for(int i = (int)'z'; i>=(int)'a' ; i--)
         {
            char Old = (char)i;
            char New = (char)(i+1);
            greetingBuilder = greetingBuilder.Replace(Old, New);
         }

         for(int i = (int)'Z'; i>=(int)'A' ; i--)
         {
            char Old = (char)i;
            char New = (char)(i+1);
            greetingBuilder = greetingBuilder.Replace(Old, New);
         }
         Console.WriteLine("Encoded:/n" + greetingBuilder.ToString());
     
      }
   }
}

印度软件行业透视.rar 下载

  • 2011年01月27日 08:27
  • 706KB
  • 下载

中国与印度软件工程师之比较…

原文地址:中国与印度软件工程师之比较(转)作者:insdili在工作中,接触到印度软件公司开发出来的软件: 整个体系架构非常清晰,按照我们的要求实现了全部功能,而且相当稳定。但是打开具体的代码一看,拖...

印度软件服务业发布2013年展望 (zz)

据印度《经济时报》报道,2013年软件外包交易总额将接近500亿美元,相当于印度IT产业规模的一半。外包企业对此前景十分艳羡,并摩拳擦掌做准备。   虽然打价格战并不新鲜,但未来的战斗预计尤其残酷,...
  • is2120
  • is2120
  • 2013年01月18日 10:17
  • 1453

深度解析:印度软件产业为何如此发达

在全球范围内,无论是发达国家,还是发展中国家,都形成了若干规模不等、各具特色的软件产业聚集地,如美国的硅谷、日本九州的硅岛、印度班加罗尔的软件园等等。这些产业聚集地已经成为全球经济格局的重要组成部分,...
  • undoner
  • undoner
  • 2012年09月21日 14:24
  • 9805

中国与印度软件工程师的比较

在工作中,接触到印度软件公司开发出来的软件: 整个体系架构非常清晰,按照我们的要求实现了全部功能,而且相当稳定。但是打开具体的代码一看,拖沓冗长,水平不咋样。我们自己的一些程序员就有怪话了,说他们水平...
  • a199228
  • a199228
  • 2012年02月16日 01:09
  • 825

MIT6.00 1x Lecture 2 - Core elements of programs 学习笔记

Lecture 2 - Core elements of programs 编程基础 2.1 Type of programming languages 编程语言的类别 • Goal: 目标(将我们想...

Arduino 平台与C语言程序设计-week4-Arduino Programs-Lesson2

This series of articles are the study notes of "An Arduino platform and C Programming", by Prof. Har...
  • iracer
  • iracer
  • 2015年12月11日 12:06
  • 693

印度人写的C#代码

  • 2007年07月15日 14:38
  • 345KB
  • 下载

印度密宗测试插件for dvbbs7.0 sp2

  • 2005年12月27日 09:38
  • 24KB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:我的印度软件老师,给的 几个C# PROGRAMS (2)
举报原因:
原因补充:

(最多只允许输入30个字)