string

C++ type conversion

Where can I find an overview of type conversion, e.g. string to integer, etc.? Because of the comments so far, I'll clarify: I'm looking for a list /table that says: To convert a string to an int, use: ... And same for other data types (where possible): double to int, char to string, ... ...

Does Java's toLowerCase() preserve original string length?

Assume two Java String objects String str = "<my string>"; String strLower = str.toLowerCase(); Is it then true that for every value of <my string> str.length() == strLower.length() evaluates to true? So, does String.toLowerCase() preserve original string length for any value of String? ...

Objective-C : Insert string into another string at a certain range

hi, i need to insert a string into another string at a certain range. I know there is the appendingString method but i need to insert it at a given range into the string. thank you ...

Report Builder 2.0 or Oracle string aggregation

In Report Builder 2.0, I'm trying to create a table with data like the following: Person | StrID's ------------------- Jim | a, b, c, d Mary | h, k Sue | l, m, p, z The problem is that my Oracle SQL query returns data in the following format: Person | StrID -------------- Jim | a Jim | b Jim | c Jim | d Mary | h...

should I use Convert class ?

For instance, in the following scenario Convert.Int64(string somstring) or long.Parse(string somstring); appear to be doing same kind of work. Which one is a better practice ? Thanks ...

ruby string concatenation (I think?)

I'm just starting with "The Well-Grounded Rubyist", and they gave the following example: print "Hello. Please enter a Celsius value: " print "The Fahrenheit equivalent is ", gets.to_i * 9 / 5 + 32, ".\n" In particular, I'm looking at line 2, where they seem to be using commas for string concatenation. I assume the + symbol isn't being...

read php output into a js string?

Basically, I have an html page and I want to create a separate javascript file that reads all of the markup between the tags into a javascript string. Is there a way to do that? EDIT Okay, so, to elaborate a little more... In my tpl.php file, I basically have these lines js snippet: <script type="text/javascript" src="/js/jquer...

question with returning an accessor method

How would I get the accessor method to return the first letter of a name to be uppercase and the rest in lowercase no matter what was entered? public class Name { private String first; private String last; /** * Constructor for objects of class Name */ public Name(String firstName, String lastName) { ...

How do I categorize user input in C#

I've learned how to store a single input of data and return a value based on it. What I want to do is obtain multiple inputs from the user, then return a result. But how do I define each input? Like, if I want the first input to be known as 'stock', and the second as 'value', how do I do that? I hope I explained my question properly....

ROR: Localised Message String Variable Substitution

I am trying to work out the best way to replace multiple variables/placeholders within localized message string in my ruby on rails application. When replacing a single placeholder I have used the satisfactory: In en.yml: url_borked: "The URL: $url could not be loaded." In view: t(:url_borked)["$url"] = request.url But this is ...

Regarding double dataype

I have a double variable test. I want to extract the all digits before decimal point and two digits after the decimal point store the output in integer variables dollar, cents. how can i do it? I dont want any rounding to happen. example: double test= 12.1234 Output int dollar =12; int cents =12; double test =1235.0 output int ...

Assigning String.Empty plus some string to a button text

I stumbled upon this code and I am curious as to what use may the string.Empty part have in it. Is it as completely useless as it seems? Am I missing something? System.Windows.Forms.ToolStripButton m_button; int errorCount; ... m_button.Text = string.Empty + errorCount + " error(s)"; ...

How do I split a string in C# based on letters and numbers.

How can I split a string such as "Mar10" into "Mar" and "10" in c#? The format of the string will always be letters then numbers so I can use the first instance of a number as an indicator for where to split the string. ...

Generating a URL pattern when provided a set of 5 or so URLs

Provided with a set of URLs, I need to generate a pattern, For example: http://www.buy.com/prod/disney-s-star-struck/q/loc/109/213724402.html http://www.buy.com/prod/samsung-f2380-23-widescreen-1080p-lcd-monitor-150-000-1-dc-8ms-1920-x/q/loc/101/211249863.html http://www.buy.com/prod/panasonic-nnh765wf-microwave-oven-countertop-1-6-ft...

Regular Expression

I want regular expression that checks that the string doesnt start with an empty space. Some what like this i want to do : Is the below ValidationExpression right for it : string ValidationExpression = @"/^[^ ]/"; if (!String.IsNullOrEmpty(GroupName) && !Regex.IsMatch(GroupName, ValidationExpression)) { } ...

Java UUID string representation natural ordering.

Say I have two UUID instances: uuid1 = UUID.randomUUID(); uuid2 = UUID.randomUUID(); If those two compare such that uuid1 is less than uuid2 i.e., uuid1.compareTo(uuid2) // -1 is it always true that their string representations will compare to give the same result, i.e., uuid1.toString().compareTo(uuid2.toString()) // -1 ???? ...

Fast 64 bit comparison

Hi I'm working on a GUI framework, where I want all the elements to be identified by ascii strings of up to 8 characters (or 7 would be ok). Every time an event is triggered (some are just clicks, but some are continuous), the framework would callback to the client code with the id and its value. I could use actual strings and strcm...

String arrays in C

I have an array of strings which when I iterate through and print its elements gives me unexpected results. char currencies[][3] = {"EUR", "GBP", "USD", "JPY", "CNY"}; void show_currencies() { int i; for(i=0; i<5; i++) { printf("%s - ", currencies[i]); } } when I call show_currencies() I get this on output. E...

Should I delete the string members of a C++ class?

If I have the following declaration: #include <iostream> #include <string> class DEMData { private: int bitFldPos; int bytFldPos; std::string byteOrder; std::string desS; std::string engUnit; std::string oTag; std::string valType; int idx; public: DEMData(); DEMData(const DEMData &d); void Se...

SQL Record Search But Field is Sometimes NULL?

Hi, I am trying to do a SQL query to see if an Address already exists in my database. My addresses are structure like this: line1 line2 line3 city state zipcode country Sometimes line2 and line3 are NULL values in my database. I am using .NET TableAdapter and DataTable to make my query. When I try to pass in my line2 parameter (@lin...