CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2013

    Smile concatenation of string and assigning to a varibale

    I have a c#program,where the string is "time warner cable,charlotte,NC"
    so I haave to split this string(comma separated) and I need to get only first value as time warner cable

    so that I need to change in db as well as front-end code

    I changed in db as LIKE companyname || '%'

    but in the front end first I need to declare a variable ,and check the value exists in company name or not and make sure that null or not using if else statement.
    how to write the code?

    my idea is
    int index = 0;
    index = comp.companyname indexof (',');

  2. #2
    Join Date
    Mar 2013

    Re: concatenation of string and assigning to a varibale


    You ca use this to get the first value of that string.

    string[] splittedString = yourString.Split(',');
    string firstPart = splittedString[0];

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.