Questions tagged as 'string'

1
answer

Function that converts hexadecimal to binary

Is there a function equivalent to bin2hex() of PHP for C #? I need to convert a hexadecimal to binary. I tried to use TryParse but it did not work.     
asked by 11.05.2016 / 17:23
3
answers

How can I convert snake_case to camelCase (and vice versa) in Python?

How can I convert a string pythonic to snake_case in%% possible? Example: snake1 = 'minha_string_snake_case' # minhaStringSnakeCase snake2 = '_teste_string' # _TestString     
asked by 03.07.2015 / 13:53
2
answers

SHA512 return in hexadecimal

I found an example of encrypting a string with SHA512. public static string HashedString(string text) { SHA512Managed sha512 = new SHA512Managed(); byte[] hash = sha512.ComputeHash(Encoding.UTF8.GetBytes(text)); StringBuilder res...
asked by 06.09.2018 / 21:44
1
answer

How to handle a String in JSON format?

Let's say I get the following content that is stored in a String: { "client_id": 1580, "videos": 4, "remote_urls": [{ "url": "rtsp://aniceurl.com" }, { "url": "rtsp://aniceurl.com" },...
asked by 01.10.2018 / 13:53
1
answer

How to delimit the number of characters written per line in a "txt" output, in the R?

I am writing a filelog and want to print it on an A4 sheet. One of the parts of this filelog has a variable, with the following structure: cod<-c(82024,82042,82067,82098,82106,82113,82141,82145,82178,82181,82184,82188,82191,82198,82212,...
asked by 19.03.2016 / 18:38
1
answer

How to save text in xml or txt or html file?

I'm developing a C # program and would like to know how to save the text of a RichTextBox in .xml or .html or .txt format.     
asked by 17.08.2015 / 22:16
1
answer

How to write the percentage symbol in a string in Java?

How to make the string accept the percent symbol ' % '?     
asked by 23.05.2015 / 17:35
2
answers

Filtering records of a String Array by space-separated words in Java

How do I filter the records of a Array by using the search terms separated by spaço ? Example: I have a% of String% with the following records. bottle opener box with blue padlock 30mm brass padlock with 03 keys 100mm scre...
asked by 07.05.2015 / 20:34
1
answer

What is the main difference between the Knuth-Morris-Pratt and Boyer-Moore algorithms

I know that KMP (Knuth-Morris-Pratt) is used to find a text Y in X, tries to set a pattern in Y, and then saves this pattern in a vector. And I also know that BM (Boyer-Moore) works best for small words. But what is the main difference in...
asked by 22.08.2017 / 15:30
1
answer

Alignment with string.format and unicode

I'm having trouble aligning strings when using .format() , for example when doing: >>> print '{:>6}'.format('agua'} agua >>> print '{:>6}'.format('água'} água Note that the first format comes out as expec...
asked by 21.09.2016 / 16:55