contains

find image src that :contains?

偶尔善良 提交于 2019-12-03 22:07:36
Morning all, I have a list of images like so: <ul id="preload" style="display:none;"> <li><img src="afx4000z-navy-icon-1_thumb.jpg"/></li> <li><img src="afx4000z-green-icon-1_thumb.jpg"/></li> </ul> Using jQuery how find all image src's within ul#preload that contain a specific string eg."green" something like... var new_src = jQuery('#preload img').attr('src')*** that contains green ***; You need to use the *= selector : jQuery('#preload img[src*="green"]') If you want it to be case insensitive, it will be a bit more difficult: var keyword = "green"; $("#preload img").filter(function(keyword)

How to detect special characters in an edit text and display a Toast in response (Android)?

江枫思渺然 提交于 2019-12-03 19:34:48
问题 An apology for my bad English, I'm using google translate. I'm creating an activity in which users must create a new profile. I put a limit to edit text of 15 characters and I want that if the new profile name has spaces or special characters display a warning. As online video games The following code helps me to detect spaces, but not special characters. I need help to identify special characters and display a warning in response. @Override public void onClick(View v) { //Convertimos el

How does contains() in PL-SQL work?

末鹿安然 提交于 2019-12-03 16:16:57
问题 Have a lot of unnecessary results using contains() method in my query. Don't tell me to use like or something else. It is hardcoded and couldn't be changed. 回答1: Contains is used on text fields that have a 'CONTEXT Index', which indexes a text field for searching. The standard usage is like this (using the score operator to display what is returned from the contains clause based on the 1 in contains matching the 1 in score ): SELECT score(1), value FROM table_name WHERE CONTAINS(textField,

Using Linq to do a Contains with multiple values

偶尔善良 提交于 2019-12-03 12:17:21
I have a medication table that I'm looking for certain drug names, but I need to search for multiple names. Here is where I currently am with it. string[] names = new string[2]; names[0] = "apixaban"; names[1] = "desirudin"; var meds = (from m in Medications where names.Any(m.BrandName.Contains) || names.Any(m.GenericName.Contains) select m); What I have isn't working, and I'm currently stuck. I know I'm close, but I can't quite figure out what's wrong. EDIT For clarification, if the name I'm searching for is desirudin, then the BrandName or Generic name will be longer, so I have to have the

Treeset.contains() problem

淺唱寂寞╮ 提交于 2019-12-03 12:15:08
So I've been struggling with a problem for a while now, figured I might as well ask for help here. I'm adding Ticket objects to a TreeSet, Ticket implements Comparable and has overridden equals(), hashCode() and CompareTo() methods. I need to check if an object is already in the TreeSet using contains(). Now after adding 2 elements to the set it all checks out fine, yet after adding a third it gets messed up. running this little piece of code after adding a third element to the TreeSet, Ticket temp2 is the object I'm checking for(verkoopLijst). Ticket temp2 = new Ticket(boeking, TicketType

IF a cell contains a string

馋奶兔 提交于 2019-12-03 10:26:46
问题 How can I assign a value to cells if it's neighbour contains a specific string? For example, fields in column A: dog11 cat22 cow11 chick11 duck22 cat11 horse22 cat33 The syntax in column B would be: =IF(SEARCH("cat",A1),"cat",IF(SEARCH("22",A1),"22","none")) It always picks up the first TRUE cell, but drops when the value is not true. 回答1: SEARCH does not return 0 if there is no match, it returns #VALUE! . So you have to wrap calls to SEARCH with IFERROR . For example... =IF(IFERROR(SEARCH(

django foreignkey contains query

南楼画角 提交于 2019-12-03 09:33:02
问题 I have the following model class Command(models.Model): server = models.ForeignKey(Server) user_login = models.CharField(max_length=100) user_run = models.CharField(max_length=100) host = models.CharField(max_length=100) ip = models.CharField(max_length=100) session = models.CharField(max_length=100) command = models.TextField() ts = models.DateTimeField(auto_now_add=True) version = models.CharField(max_length=100) type = models.CharField(max_length=100) I have the following search query cmds

How does contains() in PL-SQL work?

无人久伴 提交于 2019-12-03 05:28:23
Have a lot of unnecessary results using contains() method in my query. Don't tell me to use like or something else. It is hardcoded and couldn't be changed. Contains is used on text fields that have a 'CONTEXT Index', which indexes a text field for searching. The standard usage is like this (using the score operator to display what is returned from the contains clause based on the 1 in contains matching the 1 in score ): SELECT score(1), value FROM table_name WHERE CONTAINS(textField, 'searchString', 1) > 0; For data like this in table table_name value | textField -------|---------------------

jQuery if “this” contains

岁酱吖の 提交于 2019-12-03 04:19:36
问题 I'm trying to change any elements containing a particular text string to a red color. In my example I can get the child elements to become blue, but there's something about the way I've written the 'Replace Me' line that is incorrect; the red color change doesn't happen. I note that the "contains" method is usually written as :contains but I couldn't get that to validate with $(this) . $('#main-content-panel .entry').each(function() { $(this).css('color', 'blue'); }); $('#main-content-panel

jQuery :contains(regex)? [duplicate]

雨燕双飞 提交于 2019-12-03 04:15:58
问题 This question already has an answer here : jQuery selector :contains - Use regular expressions (1 answer) Closed 5 years ago . Is it possible to have a jQuery selector where the :contains() is a regular expression? I need to select an element where the innerHTML contains something findable through regex? I know it's a short question. My apologies. var t = $("#id a:containsRegex("/[0-9]/g")"); // Doesn't work 回答1: Try , var regex = new RegExp("[0-9]"); // expression here $("#id a").filter