Questions tagged [string-operations]

Strings or succession of characters can have various representation, either in RAM, files, databases, etc.

Their modification can programmatically be handled by various kind of function, from low level to high level.

Common operations on string can be for example:

55 questions
1
vote
2 answers

Pandas string operations (extract and findall)

Here are 2 examples on string operation methods from Python data science handbook, that I am having troubles understanding. str.extract() monte = pd.Series(['Graham Chapman', 'John Cleese', 'Terry Gilliam', 'Eric…
siegfried
  • 461
  • 1
  • 5
  • 20
1
vote
2 answers

Can I use regular expressions, the Like operator, and/or Instr() find the index of a pattern within a larger string?

I have a large list (a table with one field) of non-standardized strings, imported from a poorly managed legacy database. I need to extract the single-digit number (surrounded by spaces) that occurs exactly once in each of those strings (though the…
ErrorMeck
  • 43
  • 8
1
vote
1 answer

How To replace an partial unknown string

I Need to replace (or better delete) a string, where I know the beginning and the end. Some Characters are unknown, also the length of the string. Of Course I could work with substring and other c# string-operations but isn't there a simple replace…
Telefisch
  • 305
  • 1
  • 19
1
vote
2 answers

Get 'N' numbers of previous and next words from searched keyword from large string

I'm looking for solution where i can fetch -nth +nth numbers of words from my searched keyword from string ex. string searchString= "For several years I’ve had a little “utility” function that I’ve used in several projects that I use to convert…
Dark S
  • 308
  • 2
  • 15
1
vote
2 answers

How are the SCAS and MOVS instructions affected by the value of the direction EFLAG?

I want to know how setting or clearing the direction EFLAG changes how the SCAS and MOV instructions decrement or increment registers. I read some webpages and made the following assumptions I will list below. I am using the MASM 32 SDK - no idea…
Joachim Rives
  • 471
  • 6
  • 19
1
vote
0 answers

How can we use custom iterables with string.join()?

The join() method for srings seems to work just fine for lists of strings and other built-in iterables. However, when I define my own iterables, join() cooperate. How can be write an iterable which join() is happy to have? class IterATOR: #…
Toothpick Anemone
  • 4,290
  • 2
  • 20
  • 42
1
vote
2 answers

Azure Table Storage - Search on RowKey that ends with a particular string

I am using Azure table storage which provides very less options to query the table storage. I have my RowKey as a composed key in the following…
1
vote
1 answer

Convert tab separated strings to SQL query in bash

I have a doveadm command output separated by tabs, which looks like this: Username Quota name Type Value Limit % user2@example2.com User quota STORAGE 203032 1024000 19 some@example.com User quota MESSAGE 816 …
Sfisioza
  • 3,830
  • 6
  • 42
  • 57
1
vote
0 answers

Split a string on backslash when backslashes are followed by numbers

I have some filenames in a directory, all named like '.\subreddits\somename\somename.db'. One of these files has a number following the backslashes: .\subreddits\600euro\600euro.db I want to * iterate through all files in the dir, * get…
Anushka--x
  • 960
  • 9
  • 9
1
vote
0 answers

Replace parts of a string based on pre/suffixes in Python

I'm creating a programming language with an interpreter that is written in Python. The syntax for my language looks like this: disp "The quick brown fox jumps over the lazy dog" # 'disp' displays text disp $myStr # anything starting with $ is a…
user7450368
1
vote
2 answers

Split String with Spring EL

I needs to split string with value $$ in spring context xml file, I have tried below things, but no luck :( Anyone can help please? In java it's working something like this, public static void main(String[] args) { …
Vishal Zanzrukia
  • 4,902
  • 4
  • 38
  • 82
0
votes
1 answer

how to match a partial string from a dictionary values in python?

I want to search for a part of a string only from the values (not keys) from a dictionary in Python. But the code I have is not able to search for the part of string which I got from a device output. Here is the code n = {'show run | i mpls ldp':…
mac
  • 863
  • 3
  • 21
  • 42
0
votes
1 answer

Merging strs in a numpy array - what's the most effective way?

Let's say I have an array arr = np.array([['a ', 'b ', 'c'], ['d ', 'e ', 'f']]) and I want to turn it into [['a b c'], ['d e f']] using only vectorized operations. What's the most efficient way of doing it?
Kliker
  • 65
  • 4
0
votes
0 answers

Why my code doesn't produce correct outputs for some cases when placing it in a function while inlining it to the main method does just fine?

I already asked this question in combination with another question, but I thought those are irrelevant to each other and honestly only one was getting answered, so I created a separate question thread to maximize my chances of solving this and to…
ARG
  • 1
  • 3
0
votes
1 answer

String operation in python: handling the queries of a simple search engine

I am implementing a simple search engine that searches in a source data which is the 12k pieces of written-news of different topics. We assume that the search engine just have the ability to respond to: Phrase Queries that come with inside of the…