Questions tagged as 'string'

3
answers

Formatting Strings for RG

How can I format this String : 12345678x for this: 12.345.678-X? I tried to use String.Format but I could not. Resolved: public string RgFormat(object rg) { string strRg = rg.ToString(); return strRg.Substring(0, 2) + "."...
asked by 19.03.2015 / 19:49
2
answers

Make comparison using String.Contains () disregarding casing

I need to check if a term exists inside a string (in SQL it is something like like '%termo%' ). The point is that I need to do this without considering the casing of the two strings . How can I do this? Is there something nat...
asked by 24.01.2017 / 16:27
1
answer

String Contains Empty returns true

Why does using Contains("") in a string non-empty return true? Example if ("MinhaString".Contains("")) { Console.WriteLine("String contém vazio"); }     
asked by 21.11.2017 / 17:30
1
answer

Check if String has '+' character

I need to look up a string if it has a + character, like this: teste = teste.replaceAll("+", "e"); but I get this error:    java.util.regex.PatternsSyntaxException: Dangling meta character '+'     
asked by 02.06.2017 / 05:25
1
answer

Converting String in ArrayList

I am getting in my java code a variable with the following value String arquivo = "CNPJ;INSCRICAOESTADUAL;COD_IBGE;DT_OPE;VLR_CARTAO_CRED;VLR_CARTAO_DEB 35083840049;0;4312476;13/01/2018;0.00;66.00 35083840049;0;4312476;18/01/2018;33.00;26.00 3...
asked by 24.05.2018 / 19:53
1
answer

What is the best way to concatenate strings in Python?

I know I can concatenate strings with += , + , join() and append() . All of them give me the same result when I concatenate two strings. What is the best way to concatenate strings in Python? What is the difference be...
asked by 03.03.2017 / 04:14
1
answer

Regular Expression in Java

I'm programming in Java and need to filter a String from a regex using the matches() method. I can accept letters (a-z) or numbers (0-9), where this number can have 1 or n digits. I'm using the following regex: [A-Z|a-z|\d{n} ] ....
asked by 07.06.2014 / 03:01
1
answer

How to search for a character in a set of javascript strings

I have a set with certain strings, it's a vector, I need to do character searches in this set. Case: Be V my set of strings contemplated by: ["ana", "paula", "cris", "voa", "karmanguia"]; Be P my search, I want to c...
asked by 15.09.2017 / 15:12
1
answer

Why is it possible to store a string in a char pointer?

Why does char store a single character and the pointer points to its value in memory, so should it not have only one character? Example: char *str = "Ola"; Why str does not store just one character?     
asked by 17.11.2018 / 17:55
2
answers

How to identify a line break character in C?

Problem: Sometimes I get an entry like (andtheinputcontinues)othertimesas: (andtheinputcontinues)Thatis,Icanreceiveaninteger,ortwo,orthree,andthenlaterreceiveastringtodoanything.Myproblem:Icannotsetwhentostopreceivingtheintegers.Itriedtoiden...
asked by 24.08.2018 / 23:12