I'm creating email client, when i receive emails from blackberry server it sends file name as "=?utf-8?B?anBlZ2F0dGFjaG1lbnQuSlBFRw==?=" but the original filename was "jpegattachment.JPEG", and sometime I get the plain text when I receive from other mail servers.
So here my problem is I can get a string which may or may not be encoded.
...
Hi there
What is the fastest way to replace all instances of a string/character in a string in Javascript? A while, a for-loop, a regular expression?
Thanks in advance.
...
Hi,
I have the following string variables:
string feedImage ="http://im.media.ft.com/m/img/rss/RSS_Default_Image.gif"
rssImageStyle = "style=\"background-image:url(\'" + feedImage + "\')\"";
I want it to output the following html
background-image: url('http://im.media.ft.com/m/img/rss/RSS_Default_Image.gif');
But I get
back...
std::stringstream convertor("Tom Scott 25");
std::string name;
int age;
convertor >> name >> age;
if(convertor.fail())
{
// it fails of course
}
I'd like to extract two or more words to one string variable. So far I've read, it seems that it is not possible. If so, how else to do it? I'd like name to get all characters before ...
I am building a search that will wrap the searched text with a <span> tag and i have this code working ok:
str_ireplace($q,'<span>'.$q.'</span>',$row[name]);
The problem is, if a user searches for Tom is will show Tom which is cool, but if they put in tom because of the str_ireplace it would show tom, does that make sense? The real is...
With PHP, how can I isolate the contents of the src attribute from $foo? The end result I'm looking for would give me just "http://example.com/img/image.jpg"
$foo = '<img class="foo bar test" title="test image" src="http://example.com/img/image.jpg" alt="test image" width="100" height="100" />';
...
Just like the the iPhone's app names that run to long, the name gets shortened. I really like this method of shorting a name or a string rather then appending a "..." clause to it. Sorry if I am being confusing, I'm having trouble explaining what I am trying to do. So I'll show an example!
This is what I have, to append "..." to a shor...
How can i call a javascript function if a string contains any of the items in an array()?
Yes, i can use jquery :)
...
I'm using C for a class project for the first time after first learning C++, so syntax is killing me... Basically, I need to store a string given by a function into a separate variable for later use.
I have an array of chars declared like this
char foo[];
A function that I'm given assigns a bunch of characters into this array (or po...
I would like to obtain the string text of the elements stored in a list, say List<Car>. Would the toArray() and the toString() methods be the best options?
...
How can i check if a $string contains any of the items expressed in an array?
$string = 'My nAmE is Tom.';
$array = array("name","tom");
if(contains($string,$array))
{
// do something to say it contains
}
Any ideas?
...
Ok, I'm learning C, and I'm trying to reverse a string in place using pointers. (I know you can use an array, this is more about learning about pointers.)
I keep getting segfaults when trying to run the code below. Gcc seems not to like the *end = *begin; line. Why is that?
especially since my code is nearly identical to the non-evil ...
Hello!
I'm learning C right now and got a bit confused with character arrays - strings.
char name[15]="Fortran";
No problem with this - its an array that can hold (up to?) 15 chars
char name[]="Fortran";
C counts the number of characters for me so I don't have to - neat!
char* name;
Okay. What now? All I know is that this can h...
Hi all,
I am passing String parameter into javascript . But it is not being called. this is my script:
function downloadPopup(testing){
alert(testing); }
I am calling the javascript like this from my jsp page:
<% String testing = "DSfsdsfd" ; %> <a
href="javascript:downloadPopup(<%=testing%>)"
> Click </a>
How to resolve it?...
Which is better to use ?
string myString = "";
String.IsNullOrEmpty(myString);
or
if(myString.Length > 0 || myString != null)
EDIT:
or if (m.Length > 0 | m != null)**
Former is clearer but is there any performance difference in choosing one of above ?
What if, in case a string is never empty, like if taken from a Text Box, w...
Running on Solaris 10, I am having problems when I hit a LOG.debug statement using an Apache Log4j logger. The basic scenario is demonstrated in the following code block:
public class MyClass {
private static final Logger LOG = Logger.getLogger(MyClass.class.getName());
private LinkedHashMap<String, String> myMap =
new ...
I have:
<input type="text" value="Raphaël\nkicks\nbutt!" id="tzbox_txt">
var inputText = $("#tzbox_txt").val();
var stringText = "Raphaël\nkicks\nbutt!"
inputText === stringText - false!
If I use $(input).val() I get "Raphaël\nkicks\nbutt!" where \n is not being interpreted as line breaks.
And if I do var text = "Raphaël\nkicks\nbut...
I want to find the first index of substrings in a larger string. I only want it to match whole words and I'd like it to be case-insensitive, except that I want it to treat CamelCase as separate words.
The code below does the trick, but it's slow. I'd like to speed it up. Any suggestions? I was trying some regex stuff, but couldn't f...
Hi,
I want to connect to sql server database with smart device pocket pc application. i want to retrive all records of table from sql server database and want to show in gridview. so for this purpose i want coding for connection to database, not using wizard...
Thanks in advance
...
Consider the following code:
public class TextType {
public TextType(String text) {
underlyingString = text;
}
public static implicit operator String(TextType text) {
return text.underlyingString;
}
private String underlyingString;
}
TextType text = new TextType("Something");
String str = text; //...