Search Results

Search found 35302 results on 1413 pages for 'string literals'.

Page 115/1413 | < Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >

  • How to replace the string based on an expression

    - by deepak
    I'm having a string where i'm using some placeholders to replace it with some values based on an object. It is like the following: Hello User <#= UserName #> I need to replace the <#= UserName # with a value. How can this be done with a regex? Please help. I dont want a string replace solution. There are somany placeholders and hardcoding the <#= UserName # and replace with the value is pointless

    Read the article

  • How to convert string to any type

    - by DJPB
    Hi there I want to convert a string to a generic type I have this: string inputValue = myTxtBox.Text; PropertyInfo propInfo = typeof(MyClass).GetProperty(myPropertyName); Type propType = propInfo.PropertyType; object propValue = ????? I want to convert 'inputString' to the type of that property, to check if it's compatible how can I do that? tks

    Read the article

  • Using Regex to Split String

    - by Janusz Jasinski
    So I have a string like this (the hashtags are delimiters) A1###B2###C3###12345.jpg I was wondering how would I access A1, B2 and C3 STRING1###STRING2###STRING3###STRING4.jpg SOME###THING###HERE###MEH.jpg EXTRACT###THIS###PLEASE###pah.jpg In one instance I'd like to extract the first string. In another the second, in another the third. I will be using this with Adobe Bridge to extract metadata items from the filename I am looping through each filename so would need Var1 = FirstString Var2 = SecondString Var3 = ThirdString

    Read the article

  • Take a string to a byte[]

    - by Vaccano
    I have a string in my database that represents an image. It looks like this: 0x89504E470D0A1A0A0000000D49484452000000F00000014008020000000D8A66040.... <truncated for brevity> When I load it in from the database it comes in as a byte[]. How can I convert the string value to a byte array myself. (I am trying to remove the db for some testing code.)

    Read the article

  • C#: check if a string start with any character in a list

    - by JoesyXHN
    Hi, I want to check whether a string starts with any character in a list. My current implementation in C# is as follows: char[] columnChars = new char[] { 'A', 'B', 'C', 'D', 'E' }; private bool startWithColumn(string toCheck) { for(int i=0; i<columnChars.Length; i++) if (toCheck.StartsWith(columnChars[i]+"")) { return true; } return false; } I would like to know if any solution is better?

    Read the article

  • Empty String API arguments for actionwebservice received as "SOAP::Mapping::Object" instead of ""

    - by user311985
    I've built an API using actionwebservice and when a client calls a method to pass in an empty string (""), it's to_s value is # instead of "". But when the client passes in "hello", it's to_s value is "hello". class UsersApiController < ApiController web_service_api UserApi def create_or_update(arg1) Rails.logger.info arg1.to_s # Displays "#<SOAP::Mapping::Object:0x3a89c08>" if arg1 is an empty string end end

    Read the article

  • which delimeter to use while spliting String

    - by London
    I need to split this line string in each line, I need to get the third word(film name) but as you see the delimeter is one big blank character in some cases its small like before the numbers at the end or its big as in front of numbers at front. I tried using string split with(" ") regex, and also \t but get the out of the bounds error. 400115305 Lionel_Atwill The_Song_of_Songs_(1933_film) 7587 400115309 Brian_Aherne A_Night_to_Remember_(1943_film) 7952 Did anyone have the same problem?

    Read the article

  • Passing C string reference to C#

    - by user336109
    c code extern "C" __declspec(dllexport) int export(LPCTSTR inputFile, string &msg) { msg = "haha" } c# code [DllImport("libXmlEncDll.dll")] public static extern int XmlDecrypt(StringBuilder inputFile, ref Stringbuilder newMsg) } I got an error when I try to retrieve the content of newMsg saying that I'm trying to write to a protected memory area. What is the best way to retrieve the string from c to c#. Thanks.

    Read the article

  • Dividing a string into list according to the format given

    - by user506710
    Hello all , I have a string like "SAB_bARGS_D" . What I want is that the string gets divided into list of characters but whenever there is a _ sign the next character gets appended to the previous one. So the answer to above should be ['S','A','B_b','A','R','G','S_D'] It can be done by using a for loop traversing through the list but is there an inbuilt function that I can use..... Thanks a lot

    Read the article

  • How to filter items in a ListBox based on a searched string

    - by tiz
    Hi all, I have a Windows Forms application (C#) containing a ListBox into which I have added some items (I'm not using a DataSource). I want to filter the items in the ListBox to show only items containing a string I'm searching for. I have done this by keeping a list of the original items and selecting matching items from that list each time the search string changes and updating the ListBox.Items Is there a more elegant/efficient way to do this?

    Read the article

  • removing comma from string array

    - by sarah
    Hi, I want to execute a query like select ID from "xyz_DB"."test" where user in ('a','b') so the corresponding code is like String s="("; for(String user:selUsers){ s+= " ' " + user + " ', "; } s+=")"; Select ID from test where userId in s; The following code is forming the value of s as ('a','b',) i want to remove the comma after the end of array how to do this ?

    Read the article

  • writing string into file before calling the close()

    - by navinbecse
    I am using ofstream() to write data into file, i want to program to perform such a way that it should be keep on writting the string into the file as soon as the value gets assingned to string variable, and it should be writting before calling the close() for the buffer and while the program runs itself. can anyone help me to do that in c++.........

    Read the article

  • copy string one place to another

    - by gcc
    how can i copy part of the specific string to the another place example (aaa),(ddd),(fff),(fff),#p copy (ddd) to the side of the p (aaa),(fff),(fff),#p,(ddd) //before copyin add comma copy (fff) to side of the (ddd) (aaa),(fff),#p,(ddd),(fff) //string lenght always same

    Read the article

  • spliting the string

    - by prince23
    hi, i have an string like this string strdate =@"5/2/2006"; which is in a form of month/day/year i need to display it in a form of like this 02-05-2006 how do i format the data like this if the value is like this 12/28/2005 it should be displayed like this 28-12-2010 i know we should be splitting the data based on that we should do it. i am not getting the syntax how to do it . any help would be great

    Read the article

  • Regular expression - skip string in quotes using sed

    - by milano
    I have string like this: "Some standard text CONST_INSIDE_QUOTES" blah blah CONST "There might be another quotes" The thing is, that i want to replace all constants in string with some text, but it mustn't be applied on constants inside text in quotes. I have this regex: sed "s/([A-Z][A-Z0-9_]*)([^a-z])/<span class=\"const\"\1<\/span\2/g" which of course works for all consts. Any ideas how to exclude its apply on quotes constants? Unfortunately sed only...

    Read the article

  • Map to String in Java

    - by Dan
    When I do System.out.println(map) in Java, I get a nice output in stdout. How can I obtain this same string representation of a Map in a variable without meddling with standard output? Something like String mapAsString = Collections.toString(map)?

    Read the article

< Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >