Questions tagged [contains]
The "contains" operator/method is used to determine if an entity collection contains an element with a particular property.
3,072
questions
0
votes
1
answer
28
views
SQL How to get the records where contains keywords from another table
I need help in SQL to get the records where it contains the keywords from another table
I have a main table and another table for the keywords.
Main Table
ID
Item
11
colored paper
12
red shirt
13
...
1
vote
2
answers
34
views
Spreadsheet (GSheet) formula to check content in a column
I have rows with sentences. I need to check if at least one word of each sentence is in the column "Word Check" indicating so in each row. I tried with different formulas with no success. ...
0
votes
1
answer
22
views
CONTAINS statement in COGNOS
what I am trying to accomplish is as follows:
I am trying to have an expression that returns a value "A" if 'apple' is anywhere in the string, and return value "B" if 'bell' is ...
-3
votes
1
answer
46
views
Processing strings through conversion to array in Java [closed]
At the moment, I'm solving the following problem: I need to implement a public static makeCensored() method that replaces each occurrence of the specified word in the sentence with the sequence $#%! ...
-1
votes
3
answers
65
views
How to use Contains method to search within another collection?
I have a list of int.
List<int> numberList = new List<int>() { 1, 2, 3, 4, 8, 10, 2};
Now, I have another list of int
List<int> numberListEnhanced = new List<int>() { 1, 2, 3, ...
-4
votes
1
answer
48
views
Finding a key in the Java String [closed]
How would I get to know if the specific key exist in the Java String. For instance,
String str1 = "ArsS|fdkeyS1:abc";
String str2 = "ArsS|fd keyS1:abc";
In that case, I'm searching ...
0
votes
1
answer
30
views
Android Lambda does not contain not working correctly
Not sure why I am not getting the results I am looking for from the following Android code:
I am wanting to go into the IF only when the pckName does not contain one of the listed values in the list ...
0
votes
1
answer
40
views
in xslt match decimal with in text and write after it
I have a problem. I think it is simple but I havent found it.
like below code I want to find and match multiplier factor value like "0.05" with "005" in the note value dynamically ...
1
vote
2
answers
41
views
How to check if an element classList contains a string or word partially?
I've got this code:
const all = document.querySelectorAll('div');
let variable = 'fruits';
all.forEach((item) => {
if(item.classList.contains(variable)) {
item.style.backgroundColor = '...
0
votes
1
answer
47
views
Pyspark, find substring as whole word(s)
I would like to see if a string column is contained in another column as a whole word. There are few approaches like using contains as described here or using array_contains as described here.
The ...
1
vote
1
answer
26
views
A way to detect default value not changed and cleaning up code . Kotlin
I have been coding in Kotlin for a few months now. I still have a lot to learn I know this. I have a piece of code that in my head should work. I am not happy with how it looks, and I feel it can be ...
0
votes
0
answers
10
views
Excel Conditional Format highlight row when $H2 contains "*Bad address*"
In column H, I have notes for collections. When I have a bad address note, I want the row to highlight in a color. I tried Find($H2,"Bad address"). The result was that every line except ...
0
votes
2
answers
95
views
Array.Contains() is always false
I've been smashing my head against this problem for days and have tried a tons of different things. I've been all over the forums, tried everything I've seen with no luck. My issue could be that I don'...
0
votes
0
answers
31
views
Using my zsh with personal configuration inside a Docker
Is it possible to have my zsh setup with my aliases, theme and other settings run inside a docker container?
Typically, I use containers for development and often utilize different and new images. I ...
1
vote
2
answers
47
views
contains only is not working when I try to assert the entire json which has arrays inside it
match response contains only QA_Schema
Basically both response and QA_Schema have same content. Both have a parameter named attributes which has array of key value pairs
The following is the response
...
0
votes
2
answers
26
views
I want fill the blank values of the columns based on the same column values in pandas
Name Code
Ramesh 1234
Ramesh kumar
Suresh 4532
Sur
This is the sample data ,if name contains similar string it should populate the code
Expected result:
Name ...
-1
votes
1
answer
126
views
Testing if Rust string is contained in an array of strings [duplicate]
I'm a Rust beginner and I'm trying to extend a condition that currently tests a string for equality to another string literal, so that the test is now whether the string is contained in an array of ...
0
votes
0
answers
19
views
Problems in Creating expression of converted field
I have the following field in the database.
var valueComparer = new ValueComparer<List<string>>(
(c1, c2) => c1.SequenceEqual(c2),
c => c != null? c....
0
votes
1
answer
29
views
Pandas: Search and replace a string across all columns in a dataframe
I'm trying to search for a string 'NONE' that is in uppercase across all columns in a dataframe and replace it with 'None'. If it is already 'None' I don't do anything.
I tried using the lambda ...
1
vote
1
answer
50
views
bash delete rows contains more than three times
I have this file with some with millions of lines, I should delete with bash all lines that contain more than three times the word "..Nessuna Risposta" for row.
For example: in this output I ...
0
votes
1
answer
21
views
Why jquery not working on this page but it works on other Normal pages
I have this jquery that can detect the sentence and add the span on it
https://cognitive-assessment.iwi.unisg.dev/submission/?mode=preview&token=c5e77101c559cd672654248f52d5692a
this is the page ...
0
votes
2
answers
45
views
Swift filter an array inside a struct by another array
I've got an array of Profile's (defined from a custom struct), and inside this, I have a [String] of interests.
I want to filter out any profiles which don't match an array of preferences, but can't ...
1
vote
2
answers
42
views
In Python, I am comparing dataframes containing strings to decide if it should pass or fail. How can I stop data from passing when it should fail?
I have over 20 test cases that check a CSV for data anomalies due to data entry. This test case (#15) compares the salutation and addressee to marital status.
# Test case 15
# Compares MrtlStat to ...
0
votes
1
answer
24
views
pandas: identifying if a first n characters are letter followed by numbers
I have a dataframe with column which contains multiple reference values. I am trying to filter a ceratin group of references which follow this format:
ABCD12345678
Basically the first 4 characters are ...
0
votes
1
answer
96
views
Select rows in Big Query using CONTAINS_SUBSTR with multiple substrings
I am trying to unnest Google Analytics data in Google Big Query. My goal is to find page performance indicators for a selected group of pages of which I only have the code not the entire PagePath.
To ...
0
votes
2
answers
39
views
JSF contains and not contains [duplicate]
Looking for a solution to an old JSF page.
I am trying to use the contains method to render a combobox based on if another column contains the words red box.
If col4 contains the words 'red box' then ...
3
votes
1
answer
67
views
Text.Contains if Text contains keyword as subtext
I wish to split the sexes of animals from sentences shown in the desired column using Text.Contains:
In this slightly unusual case male is contained within female and so all results return male.
How ...
0
votes
1
answer
37
views
if each string contains a specific substring equal true, how do I make it do nothing?
I have a code that looks like this
df.loc[:,"col_1"].str.contains("125\/w+", regex= True)
and I get this
30 True
32 False
74 True
113 True
161 False
...
0
votes
1
answer
48
views
Checking for Whether Both Expression Strings Contain the Variable
I had made a fully functioning method that would grab a variable string like x or var for the equation as so:
// Equation Variable Getter
public String getVar(){
String variable = "&...
0
votes
0
answers
38
views
how to use contains in SQLAlchemy
I am working on a Flask application and need to filter data using substring on one field in database. I am using below but it is not returning any results :
c='text'
data = Model.query.filter(Model....
-1
votes
1
answer
36
views
how would i match the number of correct guesses?
I wanted to make a program like a lottery where winning numbers are randomly generated.
I used (guessednumbers.containsAll(winningnumbers) if the user guessed all the 6 numbers.
If the user only got ...
0
votes
1
answer
37
views
Comparing Head of Queue to Elements in an Array
I am trying to create a password verification program that takes the user's password, inserts the characters of the password into a queue, and then compares the head of the queue to every element of ...
0
votes
1
answer
80
views
Compare two text files if contains match in c#
I have been searching for an solution and haven't been able to find one for this situation.
How can I compare two text files so that it only displays match?
ipaddress.txt contains:
10.30.16.221
10.30....
0
votes
0
answers
17
views
.htaccess bulk redirect if contains string to new path
old Site urls is like
https://example.com/en/products/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=3934&virtuemart_category_id=275&Itemid=142
and i want to ...
0
votes
2
answers
13
views
Get the panda where function to ignore the blank values in a column?
The following code is not working the way I expect.
dfe['Activity_2'] = np.where(dfe['ZBPCENTY'].str.contains("3324"), "Yes","no")
I am checking to see if the text "...
-1
votes
2
answers
41
views
Pandas/numpy: Is there a way to check a string and to assign a value of the same row to another dataframe?
I want to check if a given string is in a df and give the value of another column in this row into a different dataframe.
I tried something like this:
string = 'ef'
df2['value']=np.where(df1['one']....
0
votes
0
answers
41
views
Cakephp 3 ORM contain condition use field from parent table
Is it possible to use a field from a parent table in the conditions of a contained table in cakephp 3? For example, I have an Entities, Locations, and Stats table. Entities have many Locations, and ...
-1
votes
1
answer
50
views
Filtering divs with buttons with JS
I'm trying to make a filter with JS.
By example; When someone click on cars button, the divs with NO brand cars should be hidden. But the problem is when after clicking cars button click also food, ...
0
votes
1
answer
89
views
Check if a column contains data from another column in python pandas
I have a dataframe in pandas like this
name url
pau lola www.paulola.com
pou gine www.cheeseham.com
pete raj www.pataraj.com
And I want to check if any of the strings in the column name are in ...
0
votes
1
answer
44
views
Match capitalise and lower case
I’m trying to match the Scala string sequence with .contains(“pear”). I’m able to match pear, but is there any other way to match no matter capital or lower case of the “Pear” other than toLowerCase ...
-2
votes
1
answer
59
views
if a cell contains a certain string delete the cell
In my vba code below right now the code searches for a string right now is red. What I would like to do is when the cell contains red it is also delete. Right now the cell can only contain red for it ...
1
vote
1
answer
38
views
How to automate snackbar message which stays only for seconds using Python Selenium
I have to automate highlighted "P" tag text.
Snapshot of the element:
I am trying with below code. But its not identifying the element.
ele = WebDriverWait(driver,10).until(EC....
0
votes
0
answers
62
views
React Google Maps API - containsLocation "b.get is not a function"
I am creating a marker where the map is clicked and I want to know if this marker is inside or outside the polygon. I use the containsLocation function for this, but I keep getting the following error ...
-3
votes
3
answers
46
views
Python: a list with an Element with "|", (and) operator
I have a function that analyse the transfer-text(buchungstext) of a bank transfer. Python looks if a word is contained in the transfer-text(buchungstext) then returns a GUID, the GUID is then the ...
-1
votes
1
answer
42
views
Concurrently check if string is in slice?
Generally to check if a string is in slice I write a function with for loop and if statement. but it's really inefficient in cases of large slices of string or struct types. is it possible to make ...
-1
votes
1
answer
171
views
how to pass in a column value in bigquery regexp_contains
The following query does not work for containsy but does for containsx and containsz
I want to be able to do search and replace with more flexibility with wildcards using word boundaries. I know I can ...
0
votes
1
answer
22
views
search for specific string and delete all cells in between vertically
I want to create a VBA function that searches for the term red and deletes all remaining cells empty cells between Red. As you can see in the photo column c represents the desired outcome. My code ...
0
votes
2
answers
88
views
Update list of items with Kotlin
Lets say i have a list of Objects (Accounts) in my RoomDatabase. And when the application starts i request the Accounts from Server in order to Update the Accounts Table.
So i query the database, ...
1
vote
1
answer
75
views
Get newly added value in Array Powershell
for (;;) {
#Get All Files from the Folder
$FolderItems = @(Get-PnPFolderItem -FolderSiteRelativeUrl $FolderURL -ItemType File)
Write-Host "Total Number of Files in the Folder:&...
2
votes
1
answer
59
views
Contains within List of doubles
Im using visual studio Immediate Window to check the content of my List. This is what I can see:
found_numbers
Count = 36
[0]: 50,82
[1]: 3358
[2]: 954
[3]: 5571
[4]: 3142
[5]: ...