Questions tagged as 'substring'

5
answers

What is the difference between substr and substring?

I want to know the difference between alert("abc".substr(0,2)); and alert("abc".substring(0,2)); Both seem to produce "ab".     
asked by 31.10.2018 / 20:54
1
answer

Sweeping String in Search of Substrings Ignoring Accentuation and Case and For Each Match Performing an Action

I need to search a string for a specific substring and for each occurrence found, I should perform a substitute action that was written in the bold version as listed, ignoring accent and case. Example: I have the list with the items:...
asked by 14.11.2017 / 18:08
2
answers

Substring Program

I have a C program that displays all the substrings of a String: #include <stdio.h> #include <stdlib.h> #include <string.h> typedef char string[100]; void substrings(string str) { if (strlen(str) >= 1) { puts...
asked by 17.08.2018 / 22:33
2
answers

Help with String algorithm

I need to make a program in which the user types a string and substring, and tells how many times this substring occurs in the main string. Ex: Main chain: "banana" Substring: "na" Repetitions: 2. I've already thought about using a String vec...
asked by 24.02.2018 / 14:27
1
answer

Find substring in recent commit messages

I'm looking for a substring in the most recent commits in my repository. I use the command git log -n1 --grep='${subString}' . But using the -n flag I will only get the last commit, which is technically the most recent. Ex:...
asked by 20.08.2018 / 19:08
3
answers

Remove first and last character from a string

I need to remove the first and last character of a String variable, I tried to use substring for this, but it is giving the following error: String index out of range And I'm not finding a way to do this, I've done it so far:...
asked by 24.10.2017 / 19:07
3
answers

Always get the last three characters without knowing the size of the String [closed]

I want to get the last three characters of a String . Example: String x = "OlaMundo" Output: ndo I can even do this using substring , the problem is that I do not know the size of String , I do not know what the wor...
asked by 11.12.2018 / 22:21
1
answer

How to remove, insert or change a single character in a field in MySql?

I have the following table in MySql: Id | comida | preco 1 | batata | 325 2 | carne | 3.10 3 | speculoos | 3.00 I wanted to be able to change the points according to the needs below: If the food = potato , inser...
asked by 17.08.2018 / 17:56
1
answer

index must refer to a coordinate of a string

My code gives error in this EXATA line, I have already re-integered and still gives the same error. it is a game of the gallows:    vLetraA = vLetraA.Substring (x, 1); full code: using System; using System.Collections.Generic; using Sys...
asked by 30.11.2018 / 16:54
0
answers

How do I sweep a string and bring different parts of it?

Using REGEX is it possible to "concatenate" masks to bring different parts of the same string? How do I sweep a string and bring different parts of it? I have a text field with the following information:    00200.035219 / 2012-15 (VOL...
asked by 26.01.2018 / 17:46