Solved

stringlen in C#

Posted on 2008-06-10
2
259 Views
Last Modified: 2013-12-17
if (Strings.Len(cellvalue.Value2) > 0)
how would i write this properly in C#.
0
Comment
Question by:mathieu_cupryk
2 Comments
 
LVL 12

Accepted Solution

by:
jandromeda earned 500 total points
ID: 21756541
If Value2 is of type string then you can get the length of that using,
cellvalue.Value2.Length

So the above line would be,
if (cellvalue.Value2.Length > 0)
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 21756545
Assumeing that cellvalue.Value2 is of type string you can do this.

if (cellvalue.Value2.Length > 0)
{
    // Then the length of the string has characters.
}
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question