473,783 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

is there some *fill* function to fill a string with char c

Hi,

I'm looking for a function that could just create a string with given
character and they should be repeated n number of times. I remember this
function used to be there in vb 6 if i remember correctly. Anyway I know i
can make my own pretty easily but just wondering if its present in the
framework.

regards,

...ab

Sep 10 '08 #1
1 2106
oh got it:

string temp = new string('c', 10);

"Abubakar" <em**********@y ahoo.comwrote in message
news:eE******** ******@TK2MSFTN GP05.phx.gbl...
Hi,

I'm looking for a function that could just create a string with given
character and they should be repeated n number of times. I remember this
function used to be there in vb 6 if i remember correctly. Anyway I know i
can make my own pretty easily but just wondering if its present in the
framework.

regards,

..ab

Sep 10 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2219
by: Chris | last post by:
Hi, I found this code that can solve a problem I have. It sends print direct to printer. Imports System Imports System.Text Imports System.Runtime.InteropServices <StructLayout(LayoutKind.Sequential)> _ Public Structure DOCINFO<MarshalAs(UnmanagedType.LPWStr)>
41
3978
by: Psykarrd | last post by:
I am trying to declare a string variable as an array of char's. the code looks like this. char name; then when i try to use the variable it dosn't work, however i am not sure you can use it the way i am trying to. Could some one please tell me what i am doing wrong, or another way of doing the same thing. i am trying to use the variable like this.
21
6669
by: simon | last post by:
From my previous post... If I have a structure, struct sFileData { char*sSomeString1; char*sSomeString2; int iSomeNum1; int iSomeNum2;
17
3644
by: JC | last post by:
sorry . i got one more problem i got a string with 4 char. i want to put that in a string with 26 char. how can i fill space on the remain char.. ?? is that i need to do a while loop do fill the space for the string? please help! thanks Jack
3
1495
by: Ben | last post by:
Hi There I am doing some unit testing at the moment, and the majority of the leg work involves taking two objects (expected vs actual) and verifying that their properties are equal. The objects that I am testing and their properties are diverse, including enums, basic system types, arrays and nested types. The objects themselves were not written by me, and do not have any overrides for equals, compare ... etc.
2
1885
by: brian_harris | last post by:
I have a 3rd party unmanged .dll. This has functions that will look up information and fill a C string passed to it with data. I want to use this data in .NET classes after it has been filled and I am programming in C++. I believe that I should use pinvoke, but I see a problem that I can't figure how to get around. I don't think I can declare the string I want as a String class since when I pass it to unmanged function it is not yet...
19
2084
by: ash | last post by:
hi friends, i have some questions whch is in my last year question papers.i need some help to get logic of these questions. 1) write a C function, that takes two strings as arguments and returns a pointer to the first occurrence of 1st string in 2nd string or NULL if it is not present. -- i tried to solve it but it seems that i am not understanding this question at all.i am taking this question as:
5
1651
by: one.1more | last post by:
Hello, somehow, the rightside part of the code got cut on most of the lines. Can someone fill up the missing code. it should work like this http://www.compcamps.com/camps2005/nmagnus/c++/diamond/diamond.exe #include <iostream> #include <math.h> using namespace std; int main() { char charshow;
24
4450
by: oliv29 | last post by:
Hello, Can anyone tell me how do i fill a structure's fields in a for loop ? #define MAX_FIELD_LEN 10 typedef struct { char field1; /*will store first string read from keyboard*/
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.