Top "Substring" questions

Part of a string, or the function/method that returns part of a string

Extracting substrings in Go

I'm trying to read an entire line from the console (including whitespace), then process it. Using bufio.ReadString, the newline …

go substring
substring index range

Code: public class Test { public static void main(String[] args) { String str = "University"; System.out.println(str.substring(4, 7)); } } Output: ers …

java string substring
Qt. get part of QString

I want to get QString from another QString, when I know necessary indexes. For example: Main string: "This is a …

qt substring qstring
Extract a substring from a string in Ruby using a regular expression

How can I extract a substring from within a string in Ruby? Example: String1 = "<name> <substring>" …

ruby regex string substring
Find substring in the string in TWIG

I want to find substring of the string or check if there is no such substring using Twig. On the …

php twig substring comparison-operators
Simple way to check if a string contains another string in C?

I'm pretty new to the language. Let's say I have a string from an HTTP request, such as char * request = "…

c string substring
Finding second occurrence of a substring in a string in Java

We are given a string, say, "itiswhatitis" and a substring, say, "is". I need to find the index of 'i' …

java string substring indexof
Delete the last two characters of the String

How can I delete the last two characters 05 of the simple string? Simple: "apple car 05" Code String[] lineSplitted = line.split(":"); …

java string substring
Shorten string without cutting words in JavaScript

I'm not very good with string manipulation in JavaScript, and I was wondering how you would go about shortening a …

javascript string substring
How to replace case-insensitive literal substrings in Java

Using the method replace(CharSequence target, CharSequence replacement) in String, how can I make the target case-insensitive? For example, the …

java string replace substring case-insensitive