在字符串中的第N个字符后返回字符 [英] Return the characters after Nth charater in a string

查看:159
本文介绍了在字符串中的第N个字符后返回字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助!有人可以让我知道如何在第n个字符后返回字符?

I need help! Can someone please let me know how to return the charaters after the nth charater?

例如,我所拥有的字符串是001棒球和002高尔夫,我想要我的代码返回棒球和高尔夫,而不是数字部分。由于数字之后的字长度并不总是相同,所以我不能使用= Right(String,n)

For example, the strings I have is "001 baseball" and "002 golf", I want my code to return baseball and golf, not the number part. Since the word after the number is not always the same length, I cannot use = Right(String, n)

任何帮助将不胜感激

推荐答案

如果你的数字总是4位数长:

If your numbers are always 4 digits long:

=RIGHT(A1,LEN(A1)-5) //'0001 Baseball' returns Baseball

如果数字是可变的(即可以大于或等于4位数),则:

If the numbers are variable (i.e. could be more or less than 4 digits) then:

=RIGHT(A1,LEN(A1)-FIND(" ",A1,1)) //'123456 Baseball returns Baseball

这篇关于在字符串中的第N个字符后返回字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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