Questions tagged as 'string'

2
answers

What is the correct way to declare a string in C?

There are several ways to declare a variable of type string in C as: char *str; char str[]; char str[100]; char str[1][100]; What I would like to know is, is there a correct way to declare a variable of type string or more recommended f...
asked by 11.09.2017 / 04:27
2
answers

Separate sentences into a String

I have this String with a space between the title (upper case) and the description:    RETURNED CARS FOR DISTRIBUTOR   Download again The code: final String linha = row.getCell(3).getTextContent().replaceAll("\t","").replaceAll("\n",""...
asked by 06.09.2017 / 15:56
2
answers

Why only one Encoding works in the algorithm?

It is as follows: I have an encryption module that encrypts a byte[] and exits another encrypted byte[] , and at the end of the output a checksum is placed; the checksum is a single byte generated by the application made by the asymm...
asked by 27.07.2017 / 05:53
4
answers

How to check if a string is contained in another?

I have several strings in a ArrayList . I would like to know how to return a string from this list that contains another string that was passed. For example, if I pass a String "Bean" , I want to return the string "AtendenteBea...
asked by 15.02.2014 / 21:37
3
answers

Regex for hexadecimal colors

I have a little doubt: I have a regex that captures in 3 groups (2 values per group) of a certain color, but this when I have 6 values (excluding #), I would like to know how to implement to catch < strong> 1 group when the color is for example...
asked by 27.03.2014 / 18:04
2
answers

Convert url from a string to hyperlink

It works for several links but if I do the same 2x link in the string does not work how? function MontarLink($texto) { if (!is_string ($texto)) return $texto; $er = "/(https:\/\/(www\.|.*?\/)?|http:\/\/(www\.|.*?\/)?|www...
asked by 19.08.2014 / 20:57
3
answers

How to find a letter in a string?

How can I test if a letter (stored in a variable) is contained in a word? ex: palavra = "palavra" escolha = "a" output    The word has 3 letters "a" in the word .... or     
asked by 01.03.2017 / 13:08
1
answer

Problem with Split () on Mono

To use a platform that has several exercises, the Uri Online Judge, and it automatically corrects the output of the program, however it is in Mono This is my code: string a = Console.ReadLine(); string[] temp = a.Split(" ");...
asked by 08.07.2018 / 00:21
2
answers

How to remove specific position characters from a string?

I have a string read from a file that contains a data and the newline special character '\ n'. Example: dado = 'teste \n' First check the string size, so I can remove the last two characters, but how can I remove pointing to the character's...
asked by 29.01.2018 / 13:20
3
answers

How to obfuscate an e-mail in PHP by filling in some of the characters before @ (at) with * (asterisks)?

I need to obfuscate the characters of the email, as I have seen many websites doing, filling some characters of this email with an asterisk. I would like the code to be as complete as possible. Example: '[email protected]' =>...
asked by 20.01.2018 / 13:08