请验证这个程序!! [英] Please Verify This program!!

查看:49
本文介绍了请验证这个程序!!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人请修改此程序适用于使用字符串和数组进行字符串处理!!



Any one please verfy this program is suitable for "String Handling Using String and Arrays"!!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace STRING_HANDLING_USING_STRING_ARRAYS
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] names = new string[2];
            names[0] = "Prakash";
            names[1] = "Samy";
            Console.WriteLine(names[0].ToLower());
            Console.WriteLine(names[0].ToUpper());
            Console.WriteLine(names[1].Clone());
            Console.WriteLine(names[0].Length);
            Console.WriteLine(names[0].Remove(3));
            Console.WriteLine(names[0].Replace('h', 't'));
            Console.WriteLine(names[0].GetType());
            Console.WriteLine(names[1].GetTypeCode());
            Console.WriteLine(names[0].Insert(0, "Praba "));
            Console.WriteLine(names[1].IndexOf("S"));
            Console.WriteLine(names[1].GetHashCode());
            Console.WriteLine(names[1].Equals(names[0]));
            Console.WriteLine(names[0].ToCharArray());
            Console.WriteLine(names[1].Trim());
            Console.WriteLine(names[0].StartsWith("S"));
            Console.WriteLine(names[0].EndsWith("h"));
            Console.WriteLine(names[0].Contains("akash"));
            Console.ReadKey();
        }
    }
}

推荐答案

您的程序编译并运行。它使用数组和字符串方法。因此在技术上它满足要求。但是,你可以更有创意(和完整)。
Your program compiles and runs. It uses both arrays and string methods. Hence technically it satisfies the requirements. You could be more creative (and complete), though.


嗯,它确实处理和操纵字符串...



但是在实践中它没有什么特别有用的,除了展示你可以用琴弦做的一些事情 - 还有更多的东西!



所以它是依赖于你的家庭作业问题的具体细节,这是否适合......个人而言,我不喜欢它只是因为它使用魔术数字,并且在名称空间中全部带有下划线的大写! :笑:



但是,我不是你的导师;)
Well, it does handle and manipulate strings...

But in practice it does nothing particularly useful, except to show some of the things you can do with strings - and there are a heck of a lot more!

So it's going to depend on the specifics of your homework question as to whether this is "suitable" or not...personally, I don't like it just because it uses magic numbers, and has all uppercase with underscores in the namespace! :laugh:

But then, I'm not your tutor ;)


你好prokash你想做什么?我不明白。如果你告诉我你想做什么,那么我可以为你写一些代码。
Hello prokash what are you trying to do? I don't understand. If you tell me what you want to do then I can write some code for you.


这篇关于请验证这个程序!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆