Questions tagged as 'string'

4
answers

How to do LTRIM () and RTRIM () in Java?

I need to process strings in Java. I know there is the trim() method, but I need a Left Trim and a Right Trim . How do I do this? For the time being I'm traversing the string with a loop and removing all the blanks from the b...
asked by 04.02.2014 / 18:55
4
answers

How to get only the numbers of a string in Javascript?

I would like to know if there are functions that return only the numeric values of a string, if any, which is the simplest and most efficient way to implement? Example: apenasNumeros("5tr1ng"); Result:    51     
asked by 01.02.2014 / 13:17
5
answers

What is the difference between substr and substring?

I want to know the difference between alert("abc".substr(0,2)); and alert("abc".substring(0,2)); Both seem to produce "ab".     
asked by 31.10.2018 / 20:54
5
answers

Test if all characters in the first string also appear in the second

I'm trying to do this function with the help of the functions strcmp() and strncmp() and I'm not having great success. Let's say that I have the string char s[] = "abc" and another string char v[] = "cdeabf" , the...
asked by 14.03.2015 / 13:36
1
answer

Do replacing strings with Regex slow down than replace?

Let's say I wanted to do something like this question How to convert CamelCase to snake_case in C #? Convert CamelCase to snake_case in C # You had some answers, but I want to highlight these two. Answer 1 string stringSnake =...
asked by 04.07.2016 / 19:10
3
answers

How to delete duplicate spaces in a string?

I have the following string : var str = "00000.00000 111111111.111111111111 33333333" I need to remove the extra spaces for it to be like this (only with 1 space): var str = "00000.00000 111111111.111111111111 33333333" How do I pro...
asked by 25.05.2014 / 02:14
3
answers

How to check if a string has only uppercase letters?

How can I check if all characters in a string are uppercase? Preferably, without the use of regular expressions.     
asked by 11.12.2013 / 17:33
3
answers

What is the meaning of the symbol || '-' || in SQL

I'm doing a query in an Oracle database and I come across this || '-' || symbology in my query . Would you like to know the meaning? Select xf0cdloc || '-' || XN4CDEMP AS LOCOMOTIVA, From Trem     
asked by 31.01.2017 / 14:07
3
answers

Why in Java is the size of an array an attribute of a String and a method?

In Java, the size of an array of any object can be obtained with length , which would be an attribute. But in the case of String is length() , a method. However, if you have a array of String , it uses length ,...
asked by 31.05.2017 / 02:18
3
answers

How to check if the end of the String is one or zero?

How can I check if at the end of a string it is 0 ? The problem with this code is that string can contain:    jrp_documento.jrp_doc_001provider | 0 I need to check if the end of the string is 1 or 0 . I have i...
asked by 08.08.2016 / 16:31