Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [substr]

A function/method that returns part of a string. Use [substring] for any questions about substrings that don't specifically involve a function/method named 'substr'.

-2 votes
0 answers
31 views

How to get all occurrences of a string using regex in R? [duplicate]

Let's say I have a string Str1 -> "[18.01,19.023],[20.0289,20.9273],[32.474742,284.383732]" This is like a set of coordinates of type [x,y] and I want to extract all the "x" and ...
Miguel_s's user avatar
-2 votes
0 answers
61 views

Space Complexity of subsets code when using bitmask

Consider the statement : string bitmask = bitset<32>(i).to_string().substr(32 - n); n is the size of a vector. What should be the space complexity for this ? My take is that it should be O(logN)....
Paper PLane's user avatar
-2 votes
2 answers
61 views

Split data in oracle

I have one table emp: CREATE TABLE EMP (ID NUMBER, DES CLOB); Actual data in table: id desc 1 I have pen in India 2 My name is pravin Create function using loop when data length ...
Pravin Jagdale's user avatar
1 vote
1 answer
59 views

Oracle SQL SUBSTR with LPAD function

I want to perform select statement in oracle database but not get the expected result. I have column value with 21 character however for 0 value it display empty space. I'm only interested to take ...
Miss aya's user avatar
1 vote
0 answers
41 views

Splitting HTML into two parts

I am splitting an HTML text into two parts. When doing that breaking HTML can happen. I had a fixing function that lookes like this: $html_intro = '<h3>Title</h3><p>Lorem ipsum dolor ...
maidan's user avatar
  • 189
0 votes
2 answers
55 views

How to Select a value in Oracle SQL after a specific string

I have a column with data like below. the sequence of info can differ. i need to extract the values for specific info and store in a different table. can anyone please help me to provide the query/...
Vicky's user avatar
  • 1
0 votes
1 answer
68 views

SQL - Stack multiple substrings in one column

I am looking to stack multiple substrings in one column. I am looking for alternatives to UNION ALL because my real data is massive and there are over 30 occurrences of sub strings for each row. Below ...
Twinkks's user avatar
0 votes
0 answers
41 views

I want this string "12 1 4" as integer outputs 12 1 4 [duplicate]

I have been trying to get a string of numbers as integer outputs. For example string "12 1 4" as space separated integer outputs 12 1 4 I wrote this code. used stoi() and substr operation. #...
Shubhendu Shekhar's user avatar
1 vote
2 answers
46 views

Oracle SUBSTR results in longer column?

It seems that SUBSTR can result in a longer column? What's going on here? CREATE TABLE t ( long_field VARCHAR2(1024) ); SELECT column_name, data_length FROM all_tab_cols WHERE ...
Tianxiang Xiong's user avatar
0 votes
2 answers
171 views

Oracle NLS Settings Special Characters Replacement Handling

I found a weird situation in Oracle Situation Faced I used substr to split the character one by one and if the byte of length >= 2 then replace it with spacing. It work successfully in my session ...
XDfox's user avatar
  • 51
0 votes
1 answer
92 views

Bulk Rename Utility: Rename Audio Track

So I want to renme multiple audio tracks FROM 10. Black Hole Sun_Soundgarden TO 10. Soundgarden_Black Hole Sun I found this: var char2find = "_"; var index = name.lastIndexOf(char2find); ...
agon024's user avatar
  • 1,007
11 votes
4 answers
1k views

Substitute last 4 digits in second and third column

I have a file as following: 2300 10 1112221234 111222123420231121PPPPD10+0000000850 ESIM 10 3334446789 333444678920231121PPPPD11+0000000950 RSIM 23 I want the outcome to be ...
Sam's user avatar
  • 235
0 votes
0 answers
18 views

Replace character at certain position within string for each row in a data frame [duplicate]

In R, for a general data frame, I want to replace the character at position with replacement for each row. # I want to replace the character at position with replacement for each row mat = data.frame( ...
nex's user avatar
  • 3
6 votes
4 answers
160 views

Replace whole column with a new value in all multiple lines

I have the following lines in a file $ cat test.txt 69|1074330570|1,sip:+121345633210x3Bverstat=TN-Validation-Passed|tel:+12134565534|0 69|1077822111|2,;tel:+2223120011~sip:[email protected];|sip:+...
Sam's user avatar
  • 235
0 votes
2 answers
201 views

Substr command in SAS not working how it's supposed to

I have a variable called GEOID10 in my SAS table which is made up of 10-11 digits. The first 4-5 digits are the State and County FIPS codes and and the last 6 digits are the Census Tract. I want to ...
randsakka's user avatar

15 30 50 per page
1
2 3 4 5
97