Top "Substring" questions

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

How do I check if a given Python string is a substring of another one?

I have two strings and I would like to check whether the first is a substring of the other. Does …

python string substring
Java: Getting a substring from a string starting after a particular character

I have a string: /abc/def/ghfj.doc I would like to extract ghfj.doc from this, i.e. the …

java string substring
How to grab substring before a specified character jQuery or JavaScript

I am trying to extract everything before the ',' comma. How do I do this in JavaScript or jQuery? …

javascript jquery substring substr
Batch file: Find if substring is in string (not in a file)

In a batch file, I have a string abcdefg. I want to check if bcd is in the string. Unfortunately …

windows batch-file cmd substring
Getting the first character of a string with $str[0]

I want to get the first letter of a string and I've noticed that $str[0] works great. I am just …

php string substring
Extracting the last n characters from a string in R

How can I get the last n characters from a string in R? Is there a function like SQL's RIGHT?

r string substring
What is the best way to do a substring in a batch file?

I want to get the name of the currently running batch file without the file extension. Thanks to this link, …

batch-file substring
How does String substring work in Swift

I've been updating some of my old code and answers with Swift 3 but when I got to Swift Strings and …

swift string range substring
Get Substring between two characters using javascript

I am trying to extract a string from within a larger string where it get everything inbetween a : and a ; …

javascript regex string substring
Replace part of a string with another string

Is it possible in C++ to replace part of a string with another string? Basically, I would like to do …

c++ string replace substring std