Questions tagged as 'string'

2
answers

Get two snippets of a confusing string

* My question is very simple: How do I get the string Argumento1 and the string Argumento2 , separated into two variables in this code of a language I'm doing: if Argumento1 = Argumento2 ( --statements; ); I just want t...
asked by 12.05.2015 / 00:00
1
answer

Concatenate columns and some with NULL value

I'm doing a select and concatenating the columns, when a column has value NULL (has no value) the entire line gets NULL follows an example: select 'teste'||CONTROLE||','||CODIGO||','||DATA||','||HISTORICO from tabela The res...
asked by 13.08.2015 / 15:47
1
answer

How to determine if a string value is in XML format?

I'm connecting to an API, or service like that, which returns me an xml when it finds data in the database, but unfortunately it returns a string if nothing is found or an error occurs. In my application I'm using the following code to connect t...
asked by 25.02.2014 / 21:47
2
answers

How to format strings and store them in a dynamic vector

In several parts of my code I just need to use bash commands to run programs on Ubuntu. To do this, format the command using sprintf and then run it with the system function. Ex: sprintf(sprintfoutput, "makeblastdb -in %s -dbtype prot -out...
asked by 30.06.2018 / 03:00
2
answers

Is it recommended to use memset before strncpy?

Normally when we want to copy the contents of a given string into another string we can use the strncat or strncpy functions. Using strncat The use of strncat to copy strings is kind of "wrong", as this functio...
asked by 19.07.2018 / 20:48
3
answers

Involve part of a string

I'm testing a function to select the part of a title that comes after the colon: $('.carousel .item .carousel-caption h2').each(function(){ var val = $(this).text(); console.log(val); var string = val.substr(val.indexOf...
asked by 05.08.2014 / 21:03
1
answer

Invert characters of a String

I have a code that I made to invert a String, but it does not match what I need. I need it to convert the order of the characters of each sentence. For example: It converts "Hi everyone!" in "real life". And what I need is for him to turn int...
asked by 14.06.2018 / 19:39
1
answer

How to print the binary representation of a character?

I need to get the binary representation of the characters of a string . I can do the hexadecimal representation with the printf itself using %x . Something like: void imprime_hex(char *input) { for(int i = 0; i < str...
asked by 26.03.2018 / 23:05
3
answers

Count characters without empty spaces

I have to count the number of characters in a string, but when empty, it counts as a character. How do I remove these gaps? Any tips?     
asked by 28.03.2014 / 17:20
1
answer

Is there a function that searches if a word exists in the text?

In PHP there is some função that does the verification of words in texts, example: A camila morreu de diabete. I want to create a function by looking for the word morreu , so after finding a if result, it looks something...
asked by 09.10.2018 / 00:51