如何从一个字符串中删除前10个字符? [英] How to remove first 10 characters from a string?

查看:262
本文介绍了如何从一个字符串中删除前10个字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何忽略字符串的第一个10个字符?

输入:

 海峡=世界,你好!

输出:

  D!


解决方案

 海峡=世界,你好!
str.Substring(10,str.Length-10)

您将需要执行长度检查否则这将抛出一个错误

How to ignore the first 10 characters of a string?

Input:

str = "hello world!";

Output:

d!

解决方案

str = "hello world!";
str.Substring(10, str.Length-10)

you will need to perform the length checks else this would throw an error

这篇关于如何从一个字符串中删除前10个字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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