从字符和使用jQuery后获取文本 [英] Get text from character and after using jQuery

查看:132
本文介绍了从字符和使用jQuery后获取文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在出现特定字符后从字符串中获取文本.

I want to get the text from a string after the occurrence of a specific character.

让我们说:texttexttext#abc 我想得到abc

Lets say: texttexttext#abc And I want to get abc

这在jquery中如何完成? (这对某些人来说可能是微不足道的,但是我在jQuery中的经验很少)

How is this done in jquery? (This might be trivial to somebody, but I have little exp in jQuery)

推荐答案

您可以这样做:

var text =  'texttexttext#abc';
var abc = text.substring(text.indexOf('#') +1);

这篇关于从字符和使用jQuery后获取文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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