Top "Substr" questions

A function/method that returns part of a string.

javascript grab part of a string after a . (dot)

I'm unable to read regex. Let's say we have this string: "mydomain.bu.pu" and I want to grab the ".…

javascript string substr
How to prevent showing the diamond question mark symbol, even using mb_substr and utf-8

I have read some other questions, tried the answers but got no result at the end. What I get is …

php substr
substr() from the 1. to the last character C++

I would like to use substr() function in order to get the chain of characters from the 1. to the last, …

c++ string substr
Put dash between every third character

I had a problem on how to put dash in every 3rd character. For example, I want ABCDEF turn into …

php string replace substr
Split string using loop to specific length sub-units

I need to split a string into specific lengths, e.g. if user specifies it to units of max length 4, …

c++ loops substr
Using PHP's substr() with special characters at the end results in question marks

When I use the substr() function in PHP, I get an question mark (a square with a question mark - …

php joomla substr
Performance about replace() or substr() in Javascript

I was wondering about Javascript performance about using string.replace() or string.substr(). Let me explain what I'm doing. I've …

javascript regex replace slice substr
PHP substr but keep HTML tags?

I am wondering if there is an elegant way to trim some text but while being HTML tag aware? For …

php substr
PHP echo part of a string from right to left

I am trying to get the ID from the end of this string the 4305 after the -. The code below …

php string substr strpos
Show 1k instead of 1,000

function restyle_text($input){ $input = number_format($input); $input_count = substr_count($input, ','); if($input_count != '0'){ …

php function numbers substr