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
0
votes
2 answers

r - How to sort words in a string?

Let's say I have a dataframe of strings. Each string is a series of numbers; there could be any quantity of numbers in each string. How can I re-sort those numbers within the string? input <- data.frame(id = c(1,2,3),str = c('400','201 17','30 1…
peachy
  • 15
  • 4
0
votes
1 answer

Scala: Int doesn't take parameters on a recursive call

I get a weird compilation error in the small Scala exercise I am working on. I have this method that is supposed to keep on asking user input until a correct answer is provided. Alas I am stumbled at the first case in my pattern matching: …
vasigorc
  • 882
  • 11
  • 22
-1
votes
2 answers

Why it is not possible to import a variable from a module by using string operators?

I have a list for variables of fruits in a python script: VariableScript.py: variableColorApple = "Red" variableWeightApple = ["5", "6", "7"] variablePriceApple = ["10", "15", "20"] variableColorApple = "Orange" variableWeightOrange =["8", "9",…
o.d.rinani
  • 23
  • 8
-1
votes
1 answer

parsing strings for specific elements - python

I have a pandas data-frame that contains a column of sentences with pattern: row 1 of column : "ID is 123 or ID is 234 or ID is 345" row 2 of column : "ID is 123 or ID is 567 or ID is 876" row 3 of column : "ID is 567 or ID is 567 or ID is 298". My…
KarimZ
  • 9
  • 4
-1
votes
5 answers

specific characters printing with Python

given a string as shown below, "[xyx],[abc].[cfd],[abc].[dgr],[abc]" how to print it like shown below ? 1.[xyz] 2.[cfd] 3.[dgr] The original string will always maintain the above-mentioned format.
PSR
  • 249
  • 1
  • 10
-1
votes
3 answers

How to split a string by multiple chars?

I have a string like this: string ip = "192.168.10.30 | SomeName". I want to split it by the | (including the spaces. With this code it is not possible unfortunately: string[] address = ip.Split(new char[] {'|'},…
PrimuS
  • 2,505
  • 6
  • 33
  • 66
-2
votes
1 answer

How do i read the verbatim code parts of a markdown file using F#

I am completely new to F#. I am trying to parse a markdown file which has some verbatim code sections in it, separated by the ``` blocks. These blocks neednot be the only characters in a line and \``` this is some code ``` and this is not is a…
Rishav Sharan
  • 2,763
  • 8
  • 39
  • 55
-2
votes
1 answer

Add space before and after all numbers in an alphanumeric string in SQL

Add space before and after all numbers in an alphanumeric string in SQL Example: aa01bb03cc -> aa 01 bb 03 cc aa nk 0221ed23xyz op09 yy -> aa nk 0221 ed 23 xyz op 09 yy
SChowdhury
  • 163
  • 1
  • 11
-3
votes
2 answers

hackerrank python 3 string operation, resume function for 8 different strings

There are 6 test cases and 5 are getting passed based on python 3 on a string operations problem, but 1 test case is failing since inception. Pls help me out. The question is as follows: 8 Strings are given in a function. Remove spaces from both…
Ajith Kan
  • 1
  • 1
  • 3
-5
votes
3 answers

C++ beginner no match for 'operator-'

I've ran into an issue with one of my intro to c++ labs. I have posted the instructions to this lab and my code below. I would like point out that Pattern B must be displayed beside pattern A(exactly as shown) and not below it. When I attempt to…
Chase
  • 87
  • 1
  • 6
1 2 3
4