Top "Substring" questions

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

How to select first 10 words of a sentence?

How do I, from an output, only select the first 10 words?

php string substring trim
What is the idiomatic scala way of finding, if a given string contains a given substring?

I have two strings in scala and I want to find out, if the bigger string (needle) contains a smaller …

regex string scala substring contains
How can I use backslashes (\) in a string?

I tried many ways to get a single backslash from an executed (I don't mean an input from html). I …

javascript string substring backslash
What is the fastest substring search algorithm?

OK, so I don't sound like an idiot I'm going to state the problem/requirements more explicitly: Needle (pattern) and …

c algorithm string substring
javascript window location href without hash?

I have: var uri = window.location.href; That provides http://example.com/something#hash What's the best and easiest way …

javascript location substring
In C find position of substring in a string

Here is a program to accept a: Sentence from a user. Word from a user. How do I find the …

c string substring strstr
warning: 'characters' is deprecated: Please use String or Substring directly

characters - an instance property of String, is deprecated from with Xcode 9.1 It was very useful to get a substring …

ios string substring swift4 xcode9.1
How to copy from a string to another string in Java?

I have two strings str1 and str2. I am trying to copy some letters from one string to the other …

java string substring charat
Better way to detect if a string contains multiple words

I am trying to create a program that detects if multiple words are in a string as fast as possible, …

java string substring contains
How to find smallest substring which contains all characters from a given string?

I have recently come across an interesting question on strings. Suppose you are given following: Input string1: "this is a …

string algorithm substring