Questions tagged [contains]

The "contains" operator/method is used to determine if an entity collection contains an element with a particular property.

The contains operator/method is used to determine whether one (or more) of the entities in an entity collection has a particular property.

3008 questions
1
vote
1 answer

return true or false in a mysql subselect if another field contains a string

I'm trying to return a value of true or false (or yes/no, etc.) as part of a select if a particular field in a table contains a substring. Select the ID, name, and whether or not a person is subscribed. A field called emailList has a comma…
Anthony
  • 1,760
  • 1
  • 23
  • 43
1
vote
6 answers

Using Java's contains(Object) method for Collections (eg HashSet) without actually having the object

I recognise that sounds a bit mad but to explain what I mean: I have a Collection (eg HashSet) containing several quite slow initialisation objects and I want to see if the Collection already contains a particular object. Let's use Vector3d as an…
Richard Tingle
  • 16,906
  • 5
  • 52
  • 77
1
vote
2 answers

JQuery Contains Selector - Multiple Text Items

I am new to JQuery and maybe am missing the obvious, but how can I filter a table using the contains selector but have it look for multiple strings using an OR operator. In other words, I would like rows containing "Red" OR "Yellow" to be hidden. So…
John
  • 11
  • 2
1
vote
2 answers

C# implement raven db full text search by the part of word

I have a grid and I need to support full text search. I need to support search not only by start with and end with, but I need to support search by the part of word. For example if I have "MyWord", I need that search will found by the part of "wor".…
Algirdas
  • 1,065
  • 1
  • 9
  • 21
1
vote
3 answers

Contains() method of List

Precisely which methods in a Class are responsible for the List's Contains() to operate? I have overloaded == in my class. But it seems to have no effect.
user366312
  • 16,949
  • 65
  • 235
  • 452
1
vote
2 answers

check an array for characters

I have got a method that reads a file, puts each word into an array of strings and then adds each word to a tree. I want to modify it so that the word is not added to the tree if it contains NON English characters eg spanish etc. I though about the…
ciastkoo
  • 92
  • 1
  • 9
1
vote
3 answers

Is jquery ":contains" selector accepts this kind of value "Banking and Finance"?

I'm having problem with the contains in jquery. It seems that it only accepts one word. Not a phrase or two words. Example: $('#div:contains('Word')'); --> This is okay $('#div:contains('Just another word')'); --> This will return empty/this will…
mr.b
  • 2,708
  • 8
  • 39
  • 64
1
vote
4 answers

Effective linq contains with anonymous type

I have a collection of anonymous objects created like this: var srcCategories = srcSet.Categories.Select(c => new { ApplicationId = c.IsGLobal ? (long?)null : c.App.Id, c.Name }); Note that this collection does not come from my data…
p.s.w.g
  • 146,324
  • 30
  • 291
  • 331
1
vote
1 answer

javaScript issue in IE but not Firefox

I have an MVC3 C# .Net web app. I am firing a javaScript method of a submit button on the onclick event. It works just fine in Firefox, I see the confirm box, but not in IE 8. In IE it is always returning true and not showing the confrim box.…
MikeTWebb
  • 9,149
  • 25
  • 93
  • 132
1
vote
2 answers

How to check if parts of a string match to a column data in sql table

I want to write a query which checks the input provided by the user with the column data of my table. i tried using LIKE and CONTAINS but it didnt work for me. eg my table data contains "Bar B Q Tonight" and if user enters "BBQ Tonight", how to deal…
just a learner
  • 57
  • 1
  • 11
1
vote
2 answers

jQuery :contains Selector if else statement

I have a results page that show users how they scored on a webform. I'm trying to display different messages based on their answer. I've set up a basic alert to show what the user has selected. var q1 =…
Nick Rivers
  • 294
  • 1
  • 6
  • 17
1
vote
1 answer

Selecting with membership testing from pandas.DataFrame which cells containing arrays

This question is part #2 of my previous one For example I have DF like that: df = pd.DataFrame({ 'A': [[e for e in xrange(x+1, x+4)] for x in xrange(0, 15, 3)], 'B': [[e*10 for e in xrange(x+1, x+4)] for x in xrange(0, 15, 3)], 'C':…
Gill Bates
  • 14,330
  • 23
  • 70
  • 138
1
vote
3 answers

Efficient use of 'Directory.GetFiles' with 'StartsWith', 'Contains' and 'EndsWith' to filter file names

Is there a more efficient way to filter file names using Directory.GetFiles and 'StartsWith', 'Contains' and 'EndsWith' with rather than the way I am currently doing it? _files = Directory.GetFiles(_path); if…
Paul Bidwell
  • 77
  • 1
  • 7
1
vote
0 answers

Java : PriorityQueue's contains() Method Not Working As Desired

I'm writing a program using A* for a computer class and cannot seem to get the contains method to function how I need it to. I am using a pair of Priority Queues to hold objects of a Node class, which I defined. I wrote an equals method in the…
1
vote
2 answers

See if div contains one or more entered words (Javascript)

I would like to check if any div contains all words entered in an input field. However, currently I am stuck in a situation that as soon as a space is entered, it starts all over, and thus sort of acts like an OR operator instead of an AND operator.…
Toine Lille
  • 55
  • 1
  • 7