473,805 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Interrogating string for number of characters, response.writin g identical number of characters on new line

Suppose I have strString. I want to determine the length of strString in #
of characters, and write that number of characters on a subsequent line as a
dummy character, say a hypen.

In other words, I want to be able to dynamically create the following
presentation in ASCII:

Title title title title title title
-------------------------

Note that the number of hyphens equals the number of characters in "Title
title title title ...", which would be stuffed in strString.

Any help out there?

BTW, thanks to all the smarties in the group who have helped me out over the
past few years. The community has helped make my career.

-KF
Jul 19 '05 #1
2 1541
theString = "Title title title title title title"
theChar = "-"
Response.Write String(Len(theS tring), theChar)

--

Ray at home
Microsoft ASP MVP
"Ken Fine" <ke*****@u.wash ington.edu> wrote in message
news:bv******** **@nntp6.u.wash ington.edu...
Suppose I have strString. I want to determine the length of strString in #
of characters, and write that number of characters on a subsequent line as a dummy character, say a hypen.

In other words, I want to be able to dynamically create the following
presentation in ASCII:

Title title title title title title
-------------------------

Note that the number of hyphens equals the number of characters in "Title
title title title ...", which would be stuffed in strString.

Any help out there?

BTW, thanks to all the smarties in the group who have helped me out over the past few years. The community has helped make my career.

-KF

Jul 19 '05 #2
Works like a charm, so simple, so sweet...Thanks again, Ray at home.

-KF

"Ray at <%=sLocation% > [MVP]" <myFirstNameATl ane34dotKOMM> wrote in message
news:OC******** ******@TK2MSFTN GP12.phx.gbl...
theString = "Title title title title title title"
theChar = "-"
Response.Write String(Len(theS tring), theChar)

--

Ray at home
Microsoft ASP MVP
"Ken Fine" <ke*****@u.wash ington.edu> wrote in message
news:bv******** **@nntp6.u.wash ington.edu...
Suppose I have strString. I want to determine the length of strString in # of characters, and write that number of characters on a subsequent line as
a
dummy character, say a hypen.

In other words, I want to be able to dynamically create the following
presentation in ASCII:

Title title title title title title
-------------------------

Note that the number of hyphens equals the number of characters in

"Title title title title ...", which would be stuffed in strString.

Any help out there?

BTW, thanks to all the smarties in the group who have helped me out over

the
past few years. The community has helped make my career.

-KF


Jul 19 '05 #3

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

Similar topics

51
8300
by: Alan | last post by:
hi all, I want to define a constant length string, say 4 then in a function at some time, I want to set the string to a constant value, say a below is my code but it fails what is the correct code? many thx!
3
3994
by: happy | last post by:
How will I read a string using scanf in that function : to the write what scanedf will be written using fprintf customer_input(cust) /*---------------------*/ struct customer_record *cust; { int i=0; printf("\nEnter customer number :"); scanf("%4d",&(*cust).customer_no);
17
4677
by: Chad Myers | last post by:
I've been perf testing an application of mine and I've noticed that there are a lot (and I mean A LOT -- megabytes and megabytes of 'em) System.String instances being created. I've done some analysis and I'm led to believe (but can't yet quantitatively establish as fact) that the two basic culprits are a lot of calls to: 1.) if( someString.ToLower() == "somestring" ) and
32
14917
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if ((someString.IndexOf("something1",0) >= 0) || ((someString.IndexOf("something2",0) >= 0) ||
8
2687
by: ais523 | last post by:
I use this function that I wrote for inputting strings. It's meant to return a pointer to mallocated memory holding one input string, or 0 on error. (Personally, I prefer to use 0 to NULL when returning null pointers.) It looks pretty watertight to me, but my version of lint complains about use of deallocated pointers, etc. Is this code completely safe on all input, or have I missed something? /* Header files included in the program...
11
1243
by: billpaterson2006 | last post by:
I've been working on some code to search for specific textstrings and act upon them insome way. I've got the conversion sorted however there is 1 problem remaining. I am trying to work out how to make it find a string like this "===" and when it has found it, I want it to add "===" to the end of the line. For example.
14
13500
by: Steve Bergman | last post by:
I'm looking for a module to do fuzzy comparison of strings. I have 2 item master files which are supposed to be identical, but they have thousands of records where the item numbers don't match in various ways. One might include a '-' or have leading zeros, or have a single character missing, or a zero that is typed as a letter 'O'. That kind of thing. These tables currently reside in a mysql database. I was wondering if there is a...
1
3065
by: kellysgirl | last post by:
Now what you are going to see posted here is both the set of instructions I was given..and the code I have written. The instructions I was given are as follows In this case, you will create a Visual Basic 2005 solution that manipulates strings. It will parse a string containing a list of items within a text box and put the individual items into the list box. It will build the textbox string by putting the list box items together into a...
28
2580
by: v4vijayakumar | last post by:
#include <string> #include <iostream> using namespace std; int main() { string str; str.resize(5); str = 't';
0
10609
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
10360
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...
1
10366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10105
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...
0
9185
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7646
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
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.