string

How do I convert a char string to a wchar_t string?

I have a string in char* format and would like to convert it to wchar_t*, to pass to a Windows function. ...

J2ME String to XML doc

Hi I'm currently calling a web service from my J2ME app and receiving the xml document as a string object. is it possible to convert the string object to a document type? Can I navigate the document inside the string? Any answers would be appreciated, been googling for a while and so far, no good. ...

Split string into equal parts using PHP

I'd like to get a string, for example 'sdasdasdsdkjsdkdjbskdbvksdbfksjdbfkdbfksdjbf' and split that up every six charaters. I don't think explode or strtok will work for that? Any ideas? ...

Why do I get an EXC_BAD_ACCESS here and how can I make it work?

I'm trying to make my code be able to separate a file into a customer database (it's delimited by many spaces and not tabs). I try to use strtok, but I get an EXC_BAD_ACCESS error. Here is my main.cpp code: #include <iostream> #include <fstream> #include <string> #include <sstream> #include "Cust.h" using namespace std; int main (int a...

Help with a C# conditional statement dealing with Strings

In my attempt at dissecting a bit of C# I am afraid I do not understand either the goal or the logic of this bit of code: if (!string.IsNullOrEmpty(str2) && (Strings.UCase(Strings.Left(str2, 1)) != Strings.Left(str2, 1))) { return false; } I understand the first part is checking if str2 is "not null", however the secon...

Non cap sensitive search C#

Hi all, I want to do a search of a list of strings, non cap sensitive. Have tried .Contains and == Is there a method to do this, or would I have to convert the entire list of strings to noncaps, then search? Cheers! ...

JAVA: check a string if there is a special character in it

How do you check a string if there is a special character like: [,],{,},{,),*,|,:,>,etc.? ...

Removing non-alphaNumerics in MySQL

Hi! Do you know any easy way to remove (or replace) all non alphanumeric characters from varchar variable in Mysql? something like String's replaceAll("[^a-zA-Z0-9]", "I") in Java ('I' is my special character but "" would be also good ) ...

Oracle SQL load table columns having special characters

I am loading / inserting data into oracle table , in case of special characters like chinese language characters, i am getting an error like row rejected because maximum size of column was exceeded, i am not getting this error for rows which have english characters which appear to be of same length for same column. I am using SUBSTR and ...

Easiest way to make all strings in C# application trimmed - or decrease number of Trim() calls?

Sorry if that question has no answer.. What is the easiest and non-verbose way to make all the strings in C# application trimmed by default? Creating new Type, or extension method, or Attribute? Are there any hacks or settings to decrease number of Trim() calls? UPD. Well, I have no particular case - just a lot of user input from UI or ...

Java Arrays- tranforming string with spaces into an array

public class MatrixMultiply{ public static void main(String[] args) { main(); } static void main() { int[] vec = { 1, 2, 3, 4, 5 }; System.out.println( mean( vec ) ); } static int mean(int[] v) { int total = 0; for (int i = 0 ; i < v.length ; i++ ) { total = tot...

How to have a function with a nullable string parameter in Go?

I'm used to Java's String where we can pass null rather than "" for special meanings, such as use a default value. In Go, string is a primitive type, so I cannot pass nil (null) to a parameter that requires a string. I could write the function using pointer type, like this: func f(s *string) so caller can call that function either a...

Java date format real simple

how would you write te date if i have a date and all i want is the month and the day like this (mm/dd) and then turn the month like this July, 08 ...

iPhone: string resource not resolved

Hi all, preemptive sorry for the newbie question. I'm trying to load strings from a resource file in an iPhone project (XCode, Objective C++). I've created a file called s.strings with the following content: /* s.strings Created by Seva on 11/22/09. */ "a"="b" The file is in UTF-16, it's in the Resources folder in the project,...

How to set a struct member of type string

I have a struct which contains a member called char *text. After I've created an object from the struct, then how do I set text to a string? ...

Using mod_rewrite to work with a custom string

I want to rewrite everything that uses this pattern... /test/?TEXT=TRUE and allow it to be /test/TEXT AND /test/TEXT2, and so on. ...

Java - Create a new String instance with specified length and filled with specific character. Best solution?

I did check the other questions; this question has its focus on solving this particular question the most efficient way. Sometimes you want to create a new string with a specified length, and with a default character filling the entire string. ie, it would be cool if you could do new String(10, '*') and create a new String from there,...

Why does Java string have a copy constructor?

Possible Duplicate: What is the purpose of the expression new String() in Java? It's immutable, why would you need to invoke String.String(String str) ? ...

Using a returned string to call a method?

I have an ArrayList and wish to be able to call an index and use the returned string for a method call. e.g. stringList.get(2)(); Is there any way I could go about this? ...

How to display integers in messagebox in Visual C#?

I am trying to use a messagebox to debug a Visual C# program. When I click a button I want a simple messagebox to popup and display the values of several integer variables. This is what I have System.Windows.Forms.MessageBox.Show(myGame.P2.Money); However the variable Money is an integer, and so I get this error: Argument '1': cann...