Category "substring"

Retrieve array of substring matched with regex in swift

Is there any way to retrieve an array of words prefixed with @ sign in a string? "@City == xyz AND @Hobby == gardening" -> ["@City","@Hobby"] I tried below

Nested if statement is only executing first part

What I want my code to do I want my code to validate user input without using Regex or isDigit operators. If all the requirements of the if statements are found

How can I use backslashes (\) in a string?

I tried many ways to get a single backslash from an executed (I don't mean an input from html). I can get special characters as tab, new line and many others

Python: find the start index of a specific word number in a string

I have this string: myString = "Tomorrow will be very very rainy" I would like to get the start index of the word number 5 (very). What I do currently, I do sp

How to index a text field or make it searchable in MySQL?

I have stored about 7 million biological protein sequences in text field of MySQL table (using InnoDB storage engine and latin1_swedish_ci collation). Sequence

remove consecutive substrings from a string without importing any packages

I want to remove consecutive "a" substrings and replace them with one "a" from a string without importing any packages. For example, I want to get abbccca from

SQL Server : finding substring using PATINDEX function

I'm writing different queries in SQL Server. I have 2 tables, Employees and Departments. Table Employees consists of EMPLOYEE_ID, ENAME, ID_DEP - department id.

SQL: Use RegEx to return multiple substrings of a specified string in column

I am querying metadata on Snowflake which contains a column of queries: select query_name from metadata query_name SELECT * FROM SYSIBM.SQLCOLUMNS SELECT * FR

How to substitute alternate positions in a string using awk

I have a lookup file that I use to search the available records in file_2 and if such records are present then replace those records with #. Currently my code i

Python : Extract mails from the string of filenames

I want to get the mail from the filenames. Here is a set of examples of filenames : string1 = "[email protected]_2022-05-11T11_59_58+00_00.pdf" strin

How to separate letters and digits from a string in php

I have a string which is combination of letters and digits. For my application i have to separate a string with letters and digits: ex:If my string is "12jan"

Does Python have a string 'contains' substring method?

I'm looking for a string.contains or string.indexof method in Python. I want to do: if not somestring.contains("blah"): continue