Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8531393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:28:27+00:00 2026-06-11T09:28:27+00:00

I am working on MVC 3. The problem is that I want to break

  • 0

I am working on MVC 3. The problem is that I want to break the string if its length more then 10. The string value coming from data base as User name. I want to apply that string on a image..
Example

public Image (string Name)
{    
}

so how to break the name string if it is more then 10 char?

public FileResult image(string image)
    {



        Bitmap bitMapImage = new Bitmap(Server.MapPath("/Content/themes/base/images/photo.png"));
      //  Bitmap bitMapImage = new Bitmap("/Content/themes/base/images/del02s(1).jpg");

        //TODO :  comment for revert the cation of no photo
        Graphics graphicImage = Graphics.FromImage(bitMapImage);
        graphicImage.SmoothingMode = SmoothingMode.AntiAlias;
        int count = image.Length;
        string[] arr4 = new string[count];
        if (image.Length > 9)
        {

            string imges = image

        }

       graphicImage.DrawString(image, new Font("Trebuchet MS,Trebuchet,Arial,sans-serif", 10, FontStyle.Bold), SystemBrushes.WindowFrame, new Point(15, 5));


         graphicImage.DrawArc(new Pen(Color.Red, 3), 90, 235, 150, 50, 0, 360); 
        MemoryStream str = new MemoryStream();
        bitMapImage.Save(str, ImageFormat.Png);


        return File(str.ToArray(), "image/png");
    }

Check this out

static void Main(string[] args)
{

        string image = "1234567890abcdefghijklmnopqrsy";
        int count = image.Length;

        if (image.Length > 9)
        {
          //getting Error
            string img1 = image.Substring(0, 10); 
            string img2 = image.Substring(10, count);//getting Error Index and length           //must refer to a location within the string.
             //Parameter name: length"



            string imge3 = img1 + "\n";
            string img4 = imge3 + img2;

            Console.WriteLine(img4);
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:28:28+00:00Added an answer on June 11, 2026 at 9:28 am

    Check out String.Substring(): http://msdn.microsoft.com/en-us/library/system.string.substring.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an asp.net MVC 3 application which is using Data Models from
I am having problem using mvc:resources in spring 3.1 configuration. Initially i was working
Just started working with .NET and MVC(1). I'm having a problem wherein in my
I am working in Asp.Net 4.0 C#-- MVC-3 . I have one problem and
I recently started working with MVC or MVC2 to be more exact. I found
I have an ASP.NET MVC 2 form that is working perfectly, doing client side
I'm working on an asp.net MVC application. I have a class that wraps a
I am working on an ASP.NET MVC application and using jQuery. I understand from
I'm working on page that allows users to edit profile info. I want them
i want jquery to take a JsonResult from my MVC controller but it does'nt

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.