在jQuery中操作字符串 [英] Manipulating Strings in jQuery

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

问题描述

如何在jQuery中编辑字符组。



在Microsoft Excel中,您可以选择一组字符并与它们一起使用:



How do you edit groups of characters in jQuery.

In Microsoft Excel you can pick out a group of characters and work with them:

Cells(1,1)=Left(string1,5)





将从左侧选择前五个字符。



你也可以从右边开始:





will pick the first five characters from the left.

You can also do that from the right:

Cells(1,1)=Right(string1,5)





你可以将两者结合起来挑选中间字符:





You can combine the two to pick out the middle characters:

Cells(1,1)=Left(Right(string1,5),2)





我想知道jQuery中是否可行。



I would like to know if this is possible in jQuery.

推荐答案

它不是真正的jQuery,而是内在的JavaScript对象 String http://www.w3schools.com/jsref/jsref_obj_string.asp [ ^ ]。



如你所见,你可以使用你需要的一切。



-SA
It''s not really jQuery, but intrinsic JavaScript object String: http://www.w3schools.com/jsref/jsref_obj_string.asp[^].

As you can see, you can use everything you need.

—SA


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

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