9,738 questions
Advice
0
votes
8
replies
277
views
How to find a substring within a string in C?
I'm a begginer in C, but i want to find for a word or substring within a longer string
#include <stdio.h>
int main() {
char string[] = "C is a programming language";
char word[...
Score of -2
3 answers
181 views
Populate an array with strings of words where each element is one word less than the previous
When I run the following code, I'm receiving this output:
PHP
PHP What
PHP What is
PHP What is PHP
However I want to receive the following output:
PHP What is PHP
PHP What is
PHP What
PHP
What thing ...
Score of -4
1 answer
133 views
how to trim, substring and make capital letters in a column [closed]
I have a table in oracle apex:
CREATE TABLE Fundusze (
Id NUMBER(10) NOT NULL,
Nazwa VARCHAR2(50) NOT NULL,
Waluta VARCHAR2(50) NOT NULL,
Typ VARCHAR2(50) NOT NULL,
CONSTRAINT ...
Score of 1
1 answer
112 views
substring(enumColumn::TEXT from 'pattern') not IMMUTABLE in PostgreSQL
As I understand it, the substring function should be immutable. However, when I try to generate a column from the expression substring(enumColumn::TEXT from '-(.+)') I get a generation expression is ...
Score of 2
1 answer
210 views
How to compare a reference combination to multiple cells and return the closest match header in Excel? [duplicate]
I'm working on an Excel sheet where I have:
A reference combination in cell S4, like 4,D,D,D,D,D,D,D
A range of combinations in W3:AH6, where each cell contains a comma-separated string like 3,A,A,A,...
Score of 1
2 answers
154 views
String pattern to extract street number and name
I have a data frame with a column of street addresses, some of which include suite, apartment, floor, etc., which are not useful in retrieving the latitude and longitude of the address.
I have ...
Score of 15
7 answers
1456 views
Split all columns in half by character position
My dataframe has a bunch of columns, each with six characters. Like this:
df = data.frame("A" = c("001000","101010","131313"),"B" = c("121212&...
Score of 0
3 answers
184 views
Line 17: Char 20: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' [solution.c] [closed]
bool isSubsequence(char* s, char* t) {
int len = 0;
bool res = false;
int k = 0;
len = strlen(t);
char str[len+1];
uint64_t z;
for (uint64_t i = 0; i < pow(2, len)...
Score of -2
3 answers
183 views
Remove substring from string that consists of same words but different separators between them
In my Java program I have the two strings x and y.
String y is a substring of x. It contains the same words in the same order as x, but the words are separated in different ways.
String x contains &...
Score of -1
2 answers
134 views
SQL string numeric value range comparison
I have a string like A18.30 and I want to compare if this falls under these 2 min and max values: A17.0 and A19.0.
A18.30 => A17.0 between A19.0 [correct]
P1A.5 => P1.0 between A2.0 [In-...
Score of 0
2 answers
106 views
Oracle SQL. how to trim a leading substring
I wish to remove a leading substring from a string. I tried to use LTRIM function, but it returned a bad result. In detail
SELECT LTRIM(' AND DAT_MOD = ...', ' AND ') FROM DUAL;
returned
T_MOD = ...
...
Score of 2
2 answers
394 views
How to check if a string contains a substring in batch
There was a question asked here with the same title, but I don't understand what it was talking about.
All I'm trying to do is see if the end-user is putting in vaguelly the same text. This will also ...
Score of -4
1 answer
135 views
Python - Iterate once over string to find all substrings and their positions
I have the following python code using regex that finds the substrings "¬[", "[", "¬(", "(", ")", "]" and get their positions
(I transformed ...
Score of 0
1 answer
46 views
How to limit string-length in a logged message?
Consider the logging call below:
logger.debug("Neither {} nor {} in {}",
pattern1, pattern2,
sql.substring(0, idx));
The intent is to cite only ...
Score of 1
1 answer
65 views
Is there a fast way to match a column of strings to each substring in a list?
I have a dataframe column which is comprised of strings. I also have a list of substrings. For every substring, I want to test it against each string in the dataframe column, returning True if the ...