【c#】c#中 字符串的基本操作
来源:互联网 发布:真实的推油经历知乎 编辑:程序博客网 时间:2024/05/25 23:25
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//字符串的处理
namespace unit5
{
class Program
{
static void Main(string[] args)
{
//string myString = "a string";
//string转换为char
//char[] myChars = myString.ToCharArray();
//Console.WriteLine(myChars);
//Console.ReadKey();
//将输入的字符串逆序输出
//Console.WriteLine("input a string");
//char []inChars = Console.ReadLine().ToCharArray();
//char[]outChars = inChars.Reverse().ToArray();
//Console.WriteLine(outChars);
//用所有的 yes 替换所有的 no
//string inString, outString;
//inString = Console.ReadLine();
//outString = inString.Replace("no", "yes");
//Console.WriteLine(outString);
//给每个单词加上双引号
string inString;
string []outString;
inString = Console.ReadLine();
outString = inString.Split(' ');
for (int i = 0; i < outString.Length; i++)
{
Console.WriteLine("\""+outString[i]+"\"");
}
Console.ReadKey();
}
}
}
阅读全文
0 0
- 【c#】c#中 字符串的基本操作
- 【c#】c#中 数组 的基本操作
- 字符串的基本操作,c语言实现
- Linux C 字符串操作的基本使用
- php中对字符串的基本操作
- Java中字符串的一些基本操作
- java中对字符串的基本操作
- Java语言中字符串的基本操作:
- Python中字符串、列表的基本操作
- c++中字符串的基本操作函数
- C#中XML的基本操作
- C#中XML的基本操作
- C#中XML的基本操作
- C#中XML的基本操作
- C#中XML的基本操作
- C#中数据库基本操作的练习
- objective-c 字符串基本操作
- C风格字符串基本操作
- 登录式shell与非登录式shell的文件自动执行顺序
- 写作建议
- Html5文本格式化
- 虚幻引擎UE4背包系统(如何制作可拖动(Drag and Drop)的背包(Scrollbox))
- This is probably because there is no OLE editor registered against the type
- 【c#】c#中 字符串的基本操作
- 《How to Get Control of Your Time and Your Life》
- struts2工作原理
- 如何去掉论坛后缀 “power by discuz!
- TinyURL的实现原理
- Unity第一人称控制器脚本解析-FPSCharacterController( FirstPersonController)
- Java-DateUtils工具类
- easyUI中出现的小的修改
- 小米趣闻