Questions tagged [contains]
The "contains" operator/method is used to determine if an entity collection contains an element with a particular property.
3,023
questions
1
vote
3
answers
33
views
How to match ancestor-or-self for contains Xpath?
I try to match ancestor-or-self of any element containing certain text string:
In step 1 matching of elements containing text works: //*[contains(text(),"ABC")].
But I struggle with the ...
0
votes
3
answers
50
views
check if string contains another column value
I have a dataframe and would like to check if a column value contains another column value.
name1 name2
0 aa aab
1 xyz x
the below doesn't work
df = df.assign(name1_contains_name2=...
-6
votes
1
answer
116
views
How do I check if string contains certain hashmap keys? [closed]
How do I check if string contains certain hashmap keys? I'm trying to make it so if the user input contains any of the HashKeys it will print out "test works". But I keep getting this error ...
0
votes
0
answers
23
views
Uncaught TypeError: Cannot set properties of undefined (setting 'display') at NodeList.forEach (<anonymous>)
js file
> const filterOption=document.querySelector('.filter-todo');
>
> filterOption.addEventListener('click',filterTodo);
> function deleteCheck(e){
> const item=e.target;
>
&...
0
votes
1
answer
34
views
Pandas: Find if the full name, acronym, or both listed in a separate data frame is present in a column in a data frame and add a column of acronyms
I have a pandas data frame that include full names and acronyms of assessment names called names_df.
enter image description here
I also have another data frame that has the information of how to use ...
-1
votes
1
answer
42
views
Identical where conditions giving different results
Why are these two queries not giving the same result?
PROC SQL;
CREATE TABLE NAME_MATCHING AS
SELECT t1.\*
FROM WORK.table1 t1
WHERE t1.names contains name1
OR t1.names contains name2
OR t1....
0
votes
1
answer
59
views
when I use the method find_image_occurrence of Appium with python, always occurred TypeError: Object of type bytes is not JSON serializable
import base64
def img_base64(img_path):
if os.path.exists(img_path):
with open(img_path, 'rb') as f_obj:
image_data = f_obj.read()
base64_d = base64.b64encode(...
0
votes
0
answers
10
views
Xslt Substring before or after space existing at some nth position
If length of String_1 is greater than 30 then I need to pull substring before or after Space that is nearest to length 30 of String_1 to the nearest space. And rest of the String_1 should be ...
0
votes
1
answer
52
views
Ignore variable with .contains method in kotlin?
Ignore an attribute from contains function. I mean if an attribute value changes it still be the same object.
I have implemented tracking of object in RecyclerView android. Now When some product is ...
0
votes
0
answers
31
views
filtering pooled data from a dataframe and assigning it to a new dataframe in R
I am trying to filter out some pooled data from a dataframe and assigning it to a new dataframe however I keep getting an error and I am really confused on how to fix this
I tried doing:
...
0
votes
2
answers
114
views
Filter Pandas dataframe by columns that are a substring of a string
I am trying to filter a dataframe using the condition that string values in a column are a substring of a string outside of the dataframe. Example below:
df = [['a', 'b', 'c'], ['hello', 'bye', 'hello'...
1
vote
5
answers
97
views
How to use contains on array of class
class product
{
attribute
setter method
getter method
}
public class main...
{
Array List of <Product> products = new ArrayList<Product>();
boolean checkProduct = products.contains(.....
0
votes
0
answers
34
views
To check whether a User Inputted string contains multiple separate segments, how would I be able to shorten the statement?
I have written a program in which I take String input from the user and the user is expected to answer yes or no. I obviously am aware that users may not always answer in verbatim to the English ...
0
votes
1
answer
48
views
DAX to check if value in table is contained in unrelated table POWER BI
I have the following table
which I am going to filter through a slicer. Let's say I selected fund AAA.
and I would like to add a column in the following table
to check whether the CPTY is contained ...
0
votes
1
answer
109
views
Are `where * contains ` and `search` the same operator in KQL?
Are where * contains and search the same operator in KQL?
E.g. are the following queries identical?
union *
| where * contains "foo"
and
union *
| search "foo"
I tried to find ...
1
vote
1
answer
91
views
Google Sheets: VLOOKUP to do "contains" instead of "equals"
I have the following formula in my main sheet:
=ARRAYFORMULA(IF(B2:B="", "", IFERROR(VLOOKUP(B2:B
, Reference!A:B, 2, FALSE), "Unknown")))
This works if there's an exact ...
0
votes
1
answer
103
views
Use value from STRING_SPLIT function inside CONTAINS
I am trying to create SQL query (via full-text search) which will return along with CONTAINS multiple terms over multiple columns.
Below what I managed to create:
SELECT * FROM table
WHERE EXISTS (
...
-2
votes
1
answer
32
views
How does `containsInAnyOrder` compare items?
I've got a CustomField class and I've overriden the equals and hashcode methods. But when I try to compare 2 lists of CustomField objects, it fails.
Why wouldn't the containsInAnyOrder work in the ...
0
votes
0
answers
20
views
Servicenow contains search
The servicenow catalog item in which the search item should be implemented with " conatins" logic
I tried using user prefernce setting , but it will have a impact on all ctalogs , but i need ...
2
votes
1
answer
60
views
Why is cherry matched and not matched?
The string "Cherry/berry" is searched for the string "cherry" and I would have thought that using re.IGNORECASE or str.lower() would give the same result, but it does not, why?
...
0
votes
2
answers
37
views
Neo4j - Replace multiple values in string list property with single value
I have a node, with a list property. The list can contain multiple similar values:
["something one", "something two", "another property", "something three"]
My ...
0
votes
0
answers
21
views
Adding and subtracting within cells containing specific text
enter image description hereI am working on a sheet that a cell would contain a 2 Letter code along with a value, for example, CE # (where # is an actual value) and CT #. For context CE is Earned Time ...
0
votes
0
answers
27
views
PS - Check a log file for particular text within a certain timeframe
I'm trying to get this to work within a PowerShell script, but it comes back with not defined.
$file = Get-Content "C:\log\clock.log"
$checktime = $(Get-Date).AddHours(-1)
$containsWord = $...
1
vote
2
answers
49
views
Can We create a Xpath with multiple contain() Function and a xpath axes
For a curiosity I tried to create an xpath of orangehrm website leave portal and I have tried to make an xpath with 2 contains and xpath axes
//*[contains(@class,'oxd-main-menu-item active') and ...
0
votes
1
answer
63
views
Why linq contains always returning false value when combined with empty and non empty strings?
Details:
In this below code _reportData.DistrictID and reportData.BeneficieryID values are "". But filter condition is not working. My requirement is to get matching values from the table.
...
0
votes
3
answers
81
views
Check if parameter contains vowels in string
I am kind of new to Java. I am trying to check if a given parameter contains vowels and if so, return a words. This is what I have so far:
public class Main {
public static void main(String[] args)...
1
vote
1
answer
89
views
SQL Server Full-Text Search Issue: Inconsistent Results Between CONTAINS and LIKE Queries with word 'za'
For the first time, I'm using full-text search. I have SQL Server 2022 Standard installed, and I've set up full-text search. I created a full-text catalog, [fullTextCatalog_CjeniciArtikli], with ...
0
votes
0
answers
184
views
Basically a 'does not contain a definition' and ' no accessible extension method' type problem
I use Unity. Node is a script that is making public bools and variable that is referenced by all scripts so its not that important and the script with the error is called Enemymover, with coordinates ...
0
votes
2
answers
66
views
How to use startsWith or contains method with string or string array?
My address as string contains this details
String address = "S/O: KANTH MEIPPEN PACHU, N-2345, THAMBULI";
Here masking to be implemented for the above mentioned address line in below format
...
0
votes
0
answers
29
views
python dataframe column value match with list (in) [duplicate]
target_sample = ['Apple','milk','nacho','cracker','potato','pear']
df = pd.DataFrame({'query':['apple watch','choco milk','nacho','banana milk','cracker','potatochips','pear juice','suncream']})
and ...
0
votes
2
answers
30
views
Is there a better way to check for each element in a dataframe that it is contained in a given string?
Let's say we have a dataframe df representing the activities of some people as follow:
index
Mary
Tristan
Louise
Arnaud
Justin
Stacy
0
Engineer
Software Engineer
Rock Singer
Rap Singer
Lumberjack
...
0
votes
2
answers
233
views
Java: Map Contains Equals to or Less Than of Another Map
How do I check if 1 subset contains less than or equal to of another subset? SMap and TMap below.
In this example, doing equation returns false.
sMap.entrySet().containsAll(tMap.entrySet())
I believe ...
0
votes
1
answer
79
views
How to not escape a character in a Django ORM?
I use Django, ORM.
I don't want the character '%' to be escaped.
name=''
author=''
annotation = 'harry%magic%school'
criterion_name = Q(name__contains=cleaned_data['name'])
criterion_author = Q(...
2
votes
3
answers
89
views
Does Java Set<String> contains() check for existence of StringBuilder?
Does Java Set contains() know how to check for the existence of StringBuilder?
I am running this problem in Leetcode. "Find Unique Binary String". Note this Question is not about Solving the ...
0
votes
2
answers
52
views
Iterating the Series.str.contain function with an AND condition
I have the following series:
series = pd.Series(['ABC', 'AAABBB', 'BBBCCSSS', 'AABBCC'])
and I would like to check if each string contains A, B and C. Such as:
x = (series.str.contains('A')) & (...
0
votes
2
answers
40
views
Trying to find subset of string in a list of string
I'm trying to find a substring in a list of string in vb.net. I'm not understanding why this doesn't work after lots of looking around on here and other places. I wrote a simple example below. I feel ...
2
votes
3
answers
101
views
JavaScript function to check for vowels
I know this is a basic questions, but I'm trying to work through a beginner's coding problem and I'm stuck on why this code doesn't work.
This is what I have so far:
const myString = "Testing for ...
0
votes
1
answer
49
views
How to use lambda to subset a dataframe column with multiple words in the same row?
I have a dataframe with people's full names.
d = {'col1': ["JOHN JAMES CONNOR", "ROBERT JAMES FORBIS", "JOSEPH ROBERT SUM", "JAMES LUM ROBERT", "MARGARET ...
0
votes
0
answers
9
views
What is causing a ValueError in my RandomForestRegressor input data with no NaN values?
[tag:[tag:`ValueError Traceback (most recent call last) in <cell line: 11>() 9 'max_depth' : [3,5,10]} 10 ---> 11 results_grid = ...
0
votes
1
answer
26
views
How can I exclude those rows that contain specific substring/word BUT containing another specific substring?
I have a data where there is a column where a child is given either a measles vaccine, polio vaccine or both. So a cell can contain "MEASLES given", POLIO given" or MEASLES and POLIO&...
0
votes
1
answer
36
views
Search for string in array - Power shell
this is my code
$Packets = @()
$Packets += Test-PXESever -ProcessorArchitecture 0 -Verbose
$Packets += Test-PXESever -ProcessorArchitecture 7 -Verbose
The output of the array $Packets looks like ...
0
votes
1
answer
94
views
how to search for caret (^) in string
I have a pandas dataframe with a bunch of strings. Some of the strings contain a caret (ie. a ^ symbol).
I am trying to remove them using this:
df['text'] = df[df['text'].str.contains('^') == False]
...
0
votes
1
answer
38
views
Changing xsl:key to use contains function
I have a small lookup file, internal_docnbr_titles.xml:
<custom-lookup>
<document number="121212">
<title>Engine Manual</title>
<...
-3
votes
1
answer
57
views
Check Integer in list of Strings in Java [closed]
How to check if list of string contains a specific integer in Java, what if we directly pass integer without parsing in list of string contains method in Java?
1
vote
2
answers
29
views
mysql not returning records that contain substring
I have a database emails that has crewEmails which contain email addresses. I'm trying to get all addresses that contain "comcast" in the address. Here's the sql I'm using:
SELECT * FROM `...
-3
votes
2
answers
77
views
C# arr.contains() using Regular Expressions
Code example
string[] black_list = { "Music", "Voice", "Animal" };
for (byte i = 0; i < black_list.Length; i++)
{
//string pattern = $@"^{Convert.ToString(...
0
votes
0
answers
44
views
Rearranging the data frame such that the required columns are next to each other
I have a dataset from a follow up study with before and after values for various tests (test "A", "B", and so on; up to 20 tests performed).
The data frame is arranged so that &...
1
vote
1
answer
114
views
Django Many2Many query to find all `things` in a group of `categories`
Given these Django models:
from django.db import models
class Thing(models.model):
name = models.CharField('Name of the Thing')
class Category(models.model):
name = models.CharField('Name of ...
1
vote
1
answer
24
views
SSRS Improving the Speed of String Counts
I've created an SSRS report that takes a single column of strings from a SQL query and counts the number of times specific values occur within the strings. For clarity's sake, the data frame I'm ...
0
votes
1
answer
33
views
Add string if the Pandas cell has a specific symbol
I have a Pandas dataframe df as follows:
ID stringColumn
0 "string1"
1 string2
2 string "3"
3 string4"
Here's what I need:
ID stringColumn
0 \"...