string

how do you convert a directoryInfo file to string

Problem is that i cant convert to string Dim path As String = "..\..\..\Tier1 downloads\CourseVB\" If countNumberOfFolders > 0 Then 'if there is a folder then ' make a reference to a directory Dim di As New IO.DirectoryInfo(path) Dim diar1 As IO.DirectoryInfo() = di.GetDirectories() Dim dra As IO.DirectoryInfo '...

searching the strings using starting characters in Jlist?

I am creating a search list in java. If I enter the beginning letters, then the corresponding words which belongs to the letters will be display on the Jlist.For that is there any build in methods is there? Then how can i search the words with starting characters? Suggest me. Thank in advance.. ...

how to use char* as char[]

Hello, I have a struct like this typedef struct bookStruct { char title[80]; char author[80]; } BookType; And I have two strings like this char *title = "A Book on C"; char *author = "A. Kelly"; Now I can't create a BookType like this BookType book = {title, author}; Can anyone tell me what is wrong? How can I do that? ...

Less-than operator failing in a PHP string

var_dump('<a>') // or var_dump("<a>") // or var_dump("\x3Ca>") // all result in string(3) "" What is going on? Only putting a space after the less-than sign works for me. PHP Version 5.2.10-2ubuntu6.4 ...

Remove characters after specific character in string, then remove substring?

I feel kind of dumb posting this when this seems kind of simple and there are tons of questions on strings/characters/regex, but I couldn't find quite what I needed (except in another language: http://stackoverflow.com/questions/2176544/remove-all-text-after-certain-point). I've got the following code: [Test] public void stringMani...

How can I Unescape and Reescape strings in .net?

I need a textbox on a WPF control that can take in text like "Commit\r\n\r" (which is the .net string "Commit\r\n\r") and convert it back to "Commit\r\n\r" as a .net string. I was hoping for a string.Unescape() and string.Escape() method pair, but it doesn't seem to exist. Am I going to have to write my own? or is there a more simple w...

c - convert a mixed-case string to all lower case

is the best/cleanest way to just do a for loop iterating through each position and call tolower() on it? ...

c - why does it make sense that indexing a character pointer is an int?

char *a = "apple"; printf("%s\n", a); // fine printf("%s\n", a[1]); // compiler complains an int is being passed Why does indexing a string pointer give me an int? I was expecting it to just print the string starting at position one (which is actually what happens when i use &a[1] instead). why do i need to get the address? ...

Parsing a file in C

I need parse through a file and do some processing into it. The file is a text file and the data is a variable length data of the form "PP1004181350D001002003..........". So there will be timestamps if there is PP so 1004181350 is 2010-04-18 13:50. The ones where there are D are the data points that are three separate data each three dig...

How can I determine a file extension given a file path in LaTeX?

I am attempting to write a LaTeX package which leverages the minted package's \inputminted command. My \mycommand command takes two parameters, the first being a path to a file, and I want to pass the file's extension to the \inputminted command: \newcommand\mycommand[2]{ \inputminted{#1}{...} } Note that the above won't work since ...

C++ Interpreter: How to emit error messages?

I want to emit dynamic error messages like all interpreters do nowadays, for example: Name error: Undefined variable would be constant, however what I want to reach is: Name error: Undefined variable 'X', in line 1 Okay. The line number was really no problem: Every error message must have a line number, so I added it to the error e...

Counting longest occurence of repeated sequence in Python

What's the easiest way to count the longest consecutive repeat of a certain character in a string? For example, the longest consecutive repeat of "b" in the following string: my_str = "abcdefgfaabbbffbbbbbbfgbb" would be 6, since other consecutive repeats are shorter (3 and 2, respectively.) How can I do this in Python? thanks. ...

string parsing occurrence in c

I have a string as const char *str = "Hello, this is an example of my string"; How could I get everything after the first comma. So for this instance: this is an example of my string Thanks ...

In Javascript convert a string so it can be used to call a property

So, I have an associative array and the keys in the array are properties of an object. I want to loop through the array and in each interation do something like this: Object.key This however does not work and results in returning undefined rather than the value of the property. Is there a way to do this? Thanks ...

Construct a LPCWSTR on WinCE in C++ (Zune/ZDK)

What's a good way to construct an LPCWSTR on WinCE 6? I'd like to find something similar to String.Format() in C#. My attempt is: OSVERSIONINFO vi; memset (&vi, 0, sizeof vi); vi.dwOSVersionInfoSize = sizeof vi; GetVersionEx (&vi); char buffer[50]; int n = sprintf(buffer, "The OS version is: %d.%d", vi.dwMajorVersion, vi.dwMinorVe...

What is the difference between Dim s As String and Dim s As [String] ?

What is the difference between: Dim s As String and Dim s As [String] ...

Print expression as is without evaluating it

i want to print the expression Xmin and Ymin as is without calculating the final value . i,e with the values of I and J as 1,2,3,4,5 example when I=1 Xmin= Xmin ((1 - 1)*10 + (1 - 1)*1) is there a way to do it .. I tried the following code, but no luck: int a, g; a = 10; g = 1; for (int J=1; J<=5; J++) { for (int I = 1; I <= ...

strstr whole string match

I'm trying to match the whole string and not just part of it. For instance, if the needle is 2, I would like to match just the string 2 and not 20, 02, or 22 or anything related. I'm using strstr as: #include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { FILE *file; char l[BUFSIZ]; int linenumber = 1; c...

Iphone. Create a latitude from a string or integers

Hi. One small conversion problem that drives me crazy. I have a string (ex "35.453454") that represents a latitude. I want to use it as a latitude for CLLocation. How can I convert the string in the proper CLLocation (in degrees) format ? Many thanks, this drives me so mad ! Thomas ...

Finding character in String in Vector.

Judging from the title, I kinda did my program in a fairly complicated way. BUT! I might as well ask anyway xD This is a simple program I did in response to question 3-3 of Accelerated C++, which is an awesome book in my opinion. I created a vector: vector<string> countEm; That accepts all valid strings. Therefore, I have a vector ...