Top "Substr" questions

A function/method that returns part of a string.

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
How to trim a file extension from a String in JavaScript?

For example, assuming that x = filename.jpg, I want to get filename, where filename could be any file name (Let's …

javascript replace substring substr indexof
What is the difference between String.slice and String.substring?

Does anyone know what the difference is between these two methods? String.prototype.slice String.prototype.substring

javascript substring slice substr
Extract a substring according to a pattern

Suppose I have a list of string: string = c("G1:E001", "G2:E002", "G3:E003") Now I hope to get …

regex r substr
What linux shell command returns a part of a string?

I want to find a linux command that can return a part of the string. In most programming languages, it's …

linux string bash substr
How do I remove the last comma from a string using PHP?

I am using a loop to get values from my database and my result is like: 'name', 'name2', 'name3…

php string substr
Get last field using awk substr

I am trying to use awk to get the name of a file given the absolute path to the file. …

unix awk substr
Extract the first 2 Characters in a string

I need to extract the 1st 2 characters in a string to later create bin plot distribution. vector: x <- …

r substr
Extract a substring between two characters in a string PHP

Is there a PHP function that can extract a phrase between 2 different characters in a string? Something like substr(); Example: $…

php substr
Delete first 3 characters and last 3 characters from String PHP

I need to delete the first 3 letters of a string and the last 3 letters of a string. I know I …

php string character strip substr