I am asking for help to solve the problem renaming the strings in array that looks like this: ["a(1)","a(6)","a","a","a","a","a","a","a","a","a",
Let's say I have a list test = ["a","bb","ph","phi","phi_ph"] where a member of test can either contain the string ph, the string phi, a combination of these two, or none of them. How can I filter this lis
I created a dataframe df where I have a column with the following values: category 20150115_Holiday_HK_Misc 20150115_Holiday_SG_Misc 20140116_DE_ProductFocus 20140116_UK_ProductFocus I want to create 3 new columns category | A | B | C 20150115_Holida
related question I am sending message from REST API to SI message channel, which delegate to a sending message adapter. The message adapter send a message to TCP client. nothing needs to be return/response. My TCP client successfully received the mes
This question already has an answer here: What is the difference between string literals and String objects in JavaScript? 7 answers I'm reading about the difference between String literal and String objects. See What is the difference between string
Current Code Below - I have to copy and paste each arr[0], arr[1], arr[2]. However, in the future I may have more or less array options and would like the code to auto update itself without needing to alter my code. Basically, I want to create a "for
I have a string like this: select name,lastname,email from contacts I want to replace the commas for +"|"+ and get something like this select name+"|"+lastname+"|"+email from contacts thats easy with string.Replace(",&qu
I'm trying to append a number of NULL characters '\0' to a string in PHP. $s = 'hello'; while(strlen($s) < 32) $s .= '\0'; However, PHP adds 2 characters (\ and 0), instead of escaping the character and adding NULL. Does anyone know to add a NULL cha
I have a table which features 37 columns, of various types, INTs and VARCHARS and 2 LONGTEXT columns. The client wants a search to search the table and find the rows that match. However, I'm having trouble with this. Here is what I've done so far: 1)
I have this Unicode list list = [u'Hello\n', u'23456\n', u'45678\n',u'85963\n']. I want it to convert into the string list as below list1 = ['Hello','23456','45678','85963'] With minimal code.You can use str() and strip() in a list comprehension : >>
How can I get the numeric value from an string? In my case string is R1350.00 and Expected output: 1350 I tried the following: $result = preg_replace("/[^a-zA-Z0-9]+/", "", 'R1350.00'); but I also want to remove the last two string 00.
I have two Strings (they can be anything) like I am a boy and I am a man. Where I am a is common. My task is to find out the common words from two strings. I used Set<String> to store the data, but it only stores unique values. So my question is, ho
My question is the following: Is there a string function that returns a count of occurrences, like substr_count(), but with a limiting option? I want to count the occurrences of 'a' in a string, but before the first newline.You can use substr() with
I'm going insane!! I don't manage to pass data from a fragment(A) to an another fragment(B). I read about using a public interface... and it seems to work, but i don't understand how to use this method. Fragment(A) package it.anddev.pagertabs; public
I want to trim the last occurring numeric characters from the String Eg: "abc123" => "abc" "abc12xyz34" => "abc12xyz" Written below snippet to extract it. Just want to explore if this can be done by regex priv
This question already has an answer here: How do you Programmatically Download a Webpage in Java 10 answers How to use java.net.URLConnection to fire and handle HTTP requests 12 answers I'd like to fetch a webpage and save the content as a string? Is
This question already has an answer here: Return multiple values from a class to method 1 answer I have a function where I want to return 2 values? Is this possible? This is my code but it doesn't seem to like that I want to return 2 values public st
I understand when you do char array[] = "string", the string literal "string" gets copied from the data segment to the stack. Is the string literal copied over character by character? Or the compiler gets the start and end address of t
using batch, i want to be able to separate a variable into two or three parts, when there is a symbol dividing them. for example if i have the string which looks like this: var1;var2; how can i get var1 to become variable and var2 to become a differe
I want to get value of choosed option in Spinner. I know, I can get this from setOnItemSelectedListener, but I don't want to use this. I have this: String spinner1odp = spinnerSubject.getSelectedItem().toString(); But result of this code is: android.
Let say I have to used a two paragraph string in my java program. What would be the best approach on this? Should the paragraph saved in a file and retrieved when used? Or there are better approach?It depends. If the paragraphs will never change, the
I am doing an OpenCart modification to an order total. This is the snippet of the code: <?php foreach ($data['totals'] as $total) { if ( $this->db->escape($total['code'])=="sub_total" || $this->db->escape($total['title'])="Su
In my C code I am given the following string as input: "c:\tc\bin\a c j k.jpg" I tried to read the input with scanf but it failed (passing the input both with and without quotation marks) and I am looking for an other solution. My code is as fol
I am trying to build a list of all the city pages on ghix.com, which does not have such a complete directory. To do this I am using their 'city id' which is unique for each city, but does not follow any particular order. I am using cURL and PHP to lo
I have a string like foobar1, foobaz2, barbar23, nobar100 I want only foobar, foobaz, barbar, nobar and ignoring the number part.If you want to strip out things that are digits, a regex can do that for you: var s = "foobar1"; s = s.replace(/\d/g
string data = "0000062456" how to split this string on 5 pieces so that I have: part[0] = "00"; part[1] = "00"; part[2] = "06"; part[3] = "24"; part[4] = "56"; Use Substring(int32, int32): part[0
I get this error when trying to take an integer and prepend "b" to it, converting it into a string: File "program.py", line 19, in getname name = "b" + num TypeError: Can't convert 'int' object to str implicitly That's relate
params = {'fruit':'orange', 'color':'red', 'size':'5'} How can I turn that into a string: fruit=orange&color=red&size=5 You can do it like this: '&'.join('%s=%s' % (k,v) for k,v in params.items()) If you are building strings for a URL it would
I'm a Python beginner, and I have a utf-8 problem. I have a utf-8 string and I would like to replace all german umlauts with ASCII replacements (in German, u-umlaut 'ΓΌ' may be rewritten as 'ue'). u-umlaut has unicode code point 252, so I tried this:
I have three strings: $str1 = "abc"; $str2 = "def"; $str3 = "ghi"; I can get the value of all of them like this: echo "$str1$str2$str3"; But I heard there is a way to join them together, so I can echo all of them wi