10-01-2008
how can i verify and captalise my first character of string
Hi ,
With some modification in below , I would like to verify my first char of string weather it is capital letter or not, if it is not than i would like to capitalize it some body help me in modifying codethis code:
text = XmTextGetString(crn1_text_modname);
if ( ( text[0] == ' ' || text[0] == '\0'))
{
show_error("Model Name is a Required Field");
return;
}
strcpy( component_buff->device_model, text );
strncpy(HARDWARE_APL_ARCHIVE->model_no, text, strlen(text)+1);
XtFree(text);
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
In the shell scripted I'm trying to write!
I would like to test the last character in a string. The string is a path/directory and I want to see if the last character is a '/'.
The string (path/directory) is inputted by a user. If the '/' character isn't present then I want to be able to... (11 Replies)
Discussion started by: dbrundrett
11 Replies
2. Programming
HI
Hi I have a character string which contains some special characters and I need it to display as a hex string.
For example, the sample i/p string: ×¥ïA Å gïÛý and
the o/p should be : D7A5EF4100C5010067EFDBFD
Any pointers or sample code pls. (5 Replies)
Discussion started by: axes
5 Replies
3. Shell Programming and Scripting
hi all,
if i do an:
"echo $string |" what should be after the pipe to display ONLY the last char of the output?
tia,
DN2 (9 Replies)
Discussion started by: DukeNuke2
9 Replies
4. Shell Programming and Scripting
how can i check whether variable contains only character from a-z or A-Z....if my variable contains any alpha numeric, numeric or any character with some special one i.e. *%&@! etcetera etcetera....then it should show me please enter only characters......
Let my variable
var1="abc77}|"
then... (9 Replies)
Discussion started by: manas_ranjan
9 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
I'm writing a script where one of the parameter is a string like:
0011001100
Then I want to do a while loop, according to the value of each character.
Could tell how I can access the value of each character in the string?
Thank you,
Gino (6 Replies)
Discussion started by: f_o_555
6 Replies
6. Shell Programming and Scripting
If I have a string defined as:
MyString=abcde
echo $MyString
How can I loop through it character by character? I haven't been able to find a way to index the string so that I loop through it.
shew01 (10 Replies)
Discussion started by: shew01
10 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I'm new to HP-UNIX programming(previously using C++). I am looking for an IF statement which would return TRUE if a substring is found in a string.
For example, if 'header' is found in 'header_cp', the IF statement will result to true.
Would appreciate any help... (1 Reply)
Discussion started by: miashaykoh
1 Replies
8. Shell Programming and Scripting
I have a string
-----
i want to replace the 3rd '-' with a character
How can i do that
Basically im trying to do hangman
I have added the '-----' string to a file called hash
and i have the character in a variable called $input
also i have the character location(index) in this variable... (12 Replies)
Discussion started by: omaral
12 Replies
9. Shell Programming and Scripting
Hi,
Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank.
Text file :
"1"|"ExternalClassDEA519CF5"|"Art1"
"2"|"ExternalClass563EA516C"|"Art3"
"3"|"ExternalClass305ED16B8"|"Art9"
...
...
... (2 Replies)
Discussion started by: fspalero
2 Replies
LEARN ABOUT ULTRIX
dwtcstextreplace
DwtCSTextReplace(3Dwt) DwtCSTextReplace(3Dwt)
Name
DwtCSTextReplace - Replaces a portion of the current text in the compound-string text widget or inserts some new text into the current text
of the compound-string text widget.
Syntax
void DwtCSTextReplace(widget, from_pos, to_pos, value)
Widget widget;
int from_pos, to_pos;
DwtCompString value;
Arguments
widget Specifies the ID of the compound-string text widget.
from_pos Specifies the first character position of the compound-string text being replaced.
to_pos Specifies the last character position of the compound-string text being replaced.
value Specifies the text to replace part of the current text in the compound-string text widget.
Description
The DwtCSTextReplace function replaces part of the text in the compound-string text widget. Within the widget, positions are numbered
starting at 0 and increasing sequentially. For example, to replace the second and third characters in the text, from_pos should be 1 and
to_pos should be 3. To insert text after the fourth character, from_pos and to_pos should both be 4.
See Also
DwtCSText(3Dwt), DwtCSTextCreate(3Dwt), DwtCSTextSetString(3Dwt), DwtCSTextGetEditable(3Dwt), DwtCSTextSetEditable(3Dwt), DwtCS-
TextGetMaxLength(3Dwt), DwtCSTextSetMaxLength(3Dwt), DwtCSTextSetSelection(3Dwt), DwtCSTextGetSelection(3Dwt)
Guide to the XUI Toolkit: C Language Binding
Guide to the XUI Toolkit Intrinsics: C Language Binding
DwtCSTextReplace(3Dwt)