contains

LinkedList.Contains. What is the mehtod used to compare objects?

LinkedList.Contains method. (.NET 2) How the objects are compared inside? (Equals? CompareTo?) MSDN tells nothing about. the situation: interface IClass { string GetName(); } class Class1 : IClass, IEquatable<Class1> { public string FirstName; public string LastName; string IClass.GetName() { return FirstName; } ...

LINQ: Entity string field contains any of an array of strings

I want to get a collection of Product entities where the product.Description property contains any of the words in a string array. It would look something like this (result would be any product which had the word "mustard OR "pickles" OR "relish" in the Description text): Dim products As List(Of ProductEntity) = New ProductRepository(...

Oracle select all rows using the contains keyword

Hi, I'm looking for a character which I can use in an oracle conatins to get ALL results. If I search for the string "test" in a title-column I use this statement: select * from my_table where contains (title, '<query><textquery grammar="CTXCAT">test</textquery></query>') > 0 With this statement I get the rows which have the "...

javascript : string contains ...

How can I check if one string contains another substring in Javascript? Usually I would expect a String.contains() method, but there doesn't seem to be one. Edit : thanks for all the answers :) however it seems that I have another problem :( when I use the ".indexof" method, Firefox refuses to start the javascript (this is for an ext...

Javascript Checking array for presence of a specific number

Hi all, I have search through quite a lot of questions here, but havent found one that i think fits my bill, so if you know of one please link to it. I have an array that i want to search through for a specific number and if that number is in the array, i then want to take an action and if not then another action. I have something lik...

jquery contains help

I have some html which I would like to manipulate. Its structure is as follows: <tr> <td> <nobr>TEXT_TO_LOOK_FOR</nobr> </td> </tr> I've written a function here which hides the row containing this text, but I'm just wondering if anyone can clean it up. I feel like it is probably making jquery do more work than it needs t...

C++ copy constructor a class that contains other objects

I know that the compiler sometimes provides a default copy constructor if you don't implement yourself. I am confused about what exactly this constructor does. If I have a class that contains other objects, none of which have a declared copy constructor, what will the behavior be? For example, a class like this: class Foo { Bar bar; }...

SQL Query between 3 tables

I have 3 tables (note this may not be the best sql db design) Room: TypeName, RoomNumber RoomType: TypeName, ... Reservation: StartDate, EndDate, TypeName, RoomNumber My input parameters are startdate and enddate. I'd like to know the distinct roomtypes available. From my understanding the solution goes like this: AvailableRoomTypes...

listView.Items.Contains with DateTime/String?

How do I check if a listView contains a DateTime or String? I've tried if (!listView1.Items.Contains(SetAlarm.Value)) But it cannot convert System.DateTime to System.Windows.Forms.ListViewItem. ...

List Duplicates on specific Class

Hi, I have a list List<T> instances where T has a date variable and a string ID. Now I need the list to remove duplicates on the string ID and only keep the latest dates. Anyone know how? I was thinking of creating a new list List<T> final and looping through the instances list. In the loop checking if the list contains an item with th...

exact String check (WPF Multitouch)

hi, I'm trying to get you into the picture firstly, I'm trying to implement a gesture in WPF4 VS2010, it is like you move your finger until it crosses a TouchPoint that you already passed by with the SAME finger , so my thought is to make a list and check for every new TouchPoint if it exists , if yes then you have done your gesture , if...

2D LinkedList.contains() in Java

Hey, everyone. I'm new to Java and I have 2D LinkedList like this: LinkedList<LinkedList<String>> albums = new LinkedList<LinkedList<String>>(); Which is filled with data like so: if (!artist.isEmpty() && !name.isEmpty()) { albums.add(new LinkedList<String>()); albums.getLast().add(artist.toString()); albums.getLast()...

NHibernate Domain Model - Adding Child Objects to Collections

Hi, I'm still learning here and have a question about child collections. I have an aggregate root called Audio, which has a collection of AudioDownloads. The downloads are records of each IP address which downloads the audio, i don't want to have duplicate records of the same IP for each Audio. In my domain i have the following functi...

how to use a variable instead of a string in <xsl:if test="contains(string, searchedforstring)">

The xsl contains function uses string values... but how can the value of the searchedforstring be assigned dynamically? It should be possible to assign the value of a text entry field in an html form to a variable and use this as the value of the searched for string in the xsl document. The following script snippet gets the value of th...

check if webpage exists and see if it contains string in vb.net

I need to check if a webpage exists if it does whether a certain string exists anywhere on the page. Preferably I'd like to do this without a webbrowser control, so that images don't have to be downloaded and it doesn't have to be rendered. So is there a way to do this? ...

CONTAINS sql function don't see underlinings

I have some table 'TableName' like Id,Name: 1 | something 2 | _something 3 | something like that 4 | some_thing 5 | ... I whant to get all rows from this table where name containes 'some'. I have 2 ways: SELECT * FROM TableName WHERE Name like '%some%' Result is table : 1 | something 2 | _something 3 | something like that 4 | some...

jQuery Xpath selector to select an element which id contains 'sometext'

I have a listbox element in aspx page which id is attributesList. I want to select this element to track its change event, but i cant directly select its id because asp.net changes its id on runtime. its id, attributesList changes into ctl00_adminPlaceHolder_attributesList. so what i want to do is to use a "contains" xpath expression ...

String contains any items in an array (case insensitive)

How can i check if a $string contains any of the items expressed in an array? $string = 'My nAmE is Tom.'; $array = array("name","tom"); if(contains($string,$array)) { // do something to say it contains } Any ideas? ...

ICollection<T>.Contains on custom types

If I have a (reference - does it matter?) type MyType which does not override the Equals method, what heuristics will be used when determining if an ICollection<MyType> contains a given instance of the type? What's the best way to use my own heuristics (e.g. check for the equality of the Id property value)? ...

SQL 2005 Full-Text-Search: How to default all user search words to a CONTAINS NEAR type FTS search.

I have an asp.net web page with a simple search text box that returns matching rows from a MSSQL 2005 database. It is currently using a LIKE statement to bring back matches, but forces the user to to type an exact phrase. Users want a more Google search type experience and so I have decided to set up and index the needed tables with FTS....