How do you reverse a string in place in C or C++?
How do you reverse a string in C or C++ without requiring a separate buffer to hold the reversed string? 20 Answers 20
How do you reverse a string in C or C++ without requiring a separate buffer to hold the reversed string? 20 Answers 20
How do I write a function to split and return an array for a string with delimiters in the C programming language? char* str = “JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC”; str_split(str,’,’); 25 Answers 25
So ” xx yy 11 22 33 ” will become “xxyy112233”. How can I achieve this? 9 Answers 9
My dataframe has a DOB column (example format 1/1/2016) which by default gets converted to Pandas dtype ‘object’. Converting this to date format with df[‘DOB’] = pd.to_datetime(df[‘DOB’]), the date gets converted to: 2016-01-26 and its dtype is: datetime64[ns]. Now I want to convert this date format to 01/26/2016 or any other general date format. How … Read more
This question already has answers here: Different between parseInt() and valueOf() in java? (11 answers) Closed 4 years ago. Aside from Integer.parseInt() handling the minus sign (as documented), are there any other differences between Integer.valueOf() and Integer.parseInt()? And since neither can parse , as a decimal thousands separator (produces NumberFormatException), is there an already available … Read more
Something I find myself doing more and more is checking a string for empty (as in “” or null) and a conditional operator. A current example: s.SiteNumber.IsNullOrEmpty() ? “No Number” : s.SiteNumber; This is just an extension method, it’s equivalent to: string.IsNullOrEmpty(s.SiteNumber) ? “No Number” : s.SiteNumber; Since it’s empty and not null, ?? won’t … Read more
Is there a way in PHP to include a constant in a string without concatenating? define(‘MY_CONSTANT’, 42); echo “This is my constant: MY_CONSTANT”; 14 Answers 14
I’m trying to understand a byte[] to string, string representation of byte[] to byte[] conversion… I convert my byte[] to a string to send, I then expect my web service (written in python) to echo the data straight back to the client. When I send the data from my Java application… Arrays.toString(data.toByteArray()) Bytes to send.. … Read more
I have a string that looks like ‘%s in %s’ and I want to know how to seperate the arguments so that they are two different %s. My mind coming from Java came up with this: ‘%s in %s’ % unicode(self.author), unicode(self.publication) But this doesn’t work so how does it look in Python? 8 Answers … Read more
How do I format a Double to a String in C# so as to have only two decimal places? If I use String.Format(“{0:0.00}%”, myDoubleValue) the number is then rounded and I want a simple truncate without any rounding. I also want the conversion to String to be culture sensitive. 15 Answers 15