菜~ % 求问
#region Using directives
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
#endregion
namespace SwitchStatement
{
partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void copy_Click(object sender, System.EventArgs e)
{
target.Text = " ";
string from = source.Text;
for (int i = 0; i != from.Length; i++)
{
char current = from[i];
copyOne(current);
}
}
private void copyOne(char current)
{
switch (current)
{
case ' < ':
target.Text += "< ";
break;
case '> ':
target.Text += "> ";
break;
case '& ':
target.Text += "& ";
break;
case '\ " ':
target.Text += "" ";
break;
case '\ ' ':
target.Text += "' ";